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

static volatile bool limitSwitchCloseActive = false;
static volatile int encoderState = 0;
static volatile int encoderPosition = 0;
static volatile int moveStartTime = 0;

static void emergencyStopISR();
static void limitSwitchCloseISR();

    test("");
}

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