 
 void loop() {  
     if (Serial.available()) {
+        Timer1.setPeriod(1000000);
+        Timer1.detachInterrupt();
         byte r = Serial.read();
 
         switch (r) {

#define Y_MIN_PIN          14
#define Y_MAX_PIN          15

#define MIN_DELAY          100 // minimum timer tick

// these are initialized in reset()
int stepsize;

            case 'n':
                readNumber();
                number = str.toInt();
                varDelayY = number;
                if (varDelayY < MIN_DELAY) varDelayY = MIN_DELAY; 
                Serial.print("speedY = ");
                Serial.println(varDelayY);
                break;

            case 'r':
                reset();
                break;

            default:
                break;
        }

        Timer1.attachInterrupt(stepperInterruptX, varDelayX);
        Timer1.attachInterrupt(stepperInterruptY, varDelayY);
    }
}
