   //wait on button release
   if (!closeButtonIn.on()) {
     currentMode = modeWait;
+    manualModeReleaseTime = millis();
   }
 }
 

/** Output Functions */

void sendOutput() {
  if (currentMode != previousMode) {
    log("mode changed");
    Serial.println(currentMode);


#define modeManualClose 4
#define modeHalt 5

unsigned long ms, motorStartTime, manualModeReleaseTime;
bool outputRequired = false;

int currentMode = modeWait;
int previousMode = modeWait;
