     digitalWrite(X_ENABLE_PIN, HIGH);
     digitalWrite(Y_ENABLE_PIN, HIGH);
 
-    Timer1.initialize(MIN_DELAY); // will be reset once stepping begins
-    Timer1.attachInterrupt(stepperInterrupt, MIN_DELAY);
+    Timer1.initialize(1000000); // will be reset once stepping begins
 
     Serial.begin(9600);
     printHelp();

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

            case 'r':
                noInterrupts();              
                reset();
                interrupts();
                break;

            default:
                break;
        }
    }
}

}

void reset() {
    stepsize = 500;
    varDelayX = MIN_DELAY;
    varDelayY = MIN_DELAY;
    moveX = -1;
    moveY = -1; 
     
    stateX = false;
    stateY = false;
}

void stepperInterruptX(void) {
    if (moveX >= 0) {
            stateX = !stateX;
            digitalWrite(X_DIR_PIN, moveX == 0 ? LOW : HIGH);
            digitalWrite(X_STEP_PIN, stateX);
    }
}

void stepperInterruptY(void) {
    if (moveY >= 0) {
          stateY = !stateY;
          digitalWrite(Y_DIR_PIN, moveY == 0 ? LOW : HIGH);
          digitalWrite(Y_STEP_PIN, stateY);
    }
}

