 static volatile bool limitSwitchCloseActive = false;
 static volatile int encoderState = 0;
 static volatile int encoderPosition = 0;
-static volatile int moveStartTime = 0;
+static unsigned long moveStartTime = 0;
 
 static void emergencyStopISR();
 static void limitSwitchCloseISR();

}

void timerTick() {
    int t = millis();
    if (t - moveStartTime > MAX_MOVE_DURATION) {
        motorShield.setM1Speed(0);
        motorShield.setM2Speed(0);

    test("");
}

void logger(String msg, unsigned long timeMillis=0) {
    if (timeMillis == 0) {
        timeMillis = millis();
    }
