 #define MAX_RUDDER 10.0
 
 unsigned long lastDataPacketSent;
-unsigned long timeOnCurrentTack;
+unsigned long timeOnTackSequence;
+unsigned long lastAutomaticUpdate;
 
 char state;
 char remoteState;

    case SBTSailbotModelHeaderAutomaticControl: {
        remoteState = SBTSailbotModelStateAutomaticControl;
        int newHeading;
        memcpy(&newHeading, &data[1], sizeof(newHeading));
        automaticHeading = ((float)newHeading) * M_PI / 180.0;
        Serial.print("Automatic heading: "); Serial.println(automaticHeading);

  RFduinoBLE.begin();

  lastDataPacketSent = millis();
  lastAutomaticUpdate = millis();
}

void setRudder(float newAngle) {
