 byte directionPin = 49;
 byte enablePin = 28;
 byte stepPin = 36;
-int numberOfSteps = 5000;
+int numberOfSteps = 2000;
 byte ledPin = 13;
 int pulseHigh = 200;  // microseconds
 int pulseLow = 5; // microseconds

byte MS2 = 39;
int slaveSelectPin = 38;
int yAxisDigiPot = 5;
int upTime = 1; //sec
int platTime = 4; //sec

void setup() {

  digitalWrite(ledPin, LOW);
  digitalWrite(directionPin, HIGH);

//  int upSteps = 1000000.0*upTime/(pulseHigh+pulseLow);
  float pulseHighDec = 0.5;// (550.0 - pulseHigh)/upSteps;
  int upSteps = (550-pulseHigh)/pulseHighDec;
  float pulseLowDec = (100.0 - pulseLow)/upSteps;
  Serial.println(pulseLowDec);
  for (int n = upSteps; n > 0; n--){
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseHigh+pulseHighDec*n);
