   {
     powerEnabled = !powerEnabled;
     
-    if (powerEnabled)
-    {
-      nextClockTick = millis() + 1000;
-    }
-    else
+    if (!powerEnabled)
     {
       WriteClock();
     }

const uint32_t* maximumEepromAddress = (uint32_t*)1024 - 1;

// Switches using the Bounce library for debouncing
Bounce onOffSwitch = Bounce(onOffSwitchInPin, switchDebounceTime);
Bounce directionSwitch = Bounce(directionSwitchInPin, switchDebounceTime);
Bounce clockResetSwitch = Bounce(clockResetInPin, switchDebounceTime);
Bounce debugDisplaySwitch = Bounce(debugDisplayInPin, switchDebounceTime);

LCDserNHD lcd(2, 16);

// State variables
int targetSpeed = 0;
int currentSpeed = 0;
int delayBetweenAdjustments = 15;
boolean powerEnabled = false;
int targetDirection = CLOCKWISE;
int currentDirection = CLOCKWISE;
volatile int motorTicks = 0;
unsigned long lastDisplayTime = 0;
unsigned long nextClockTick = 0;
unsigned long secondsOfOperation = 0;
uint32_t* nextClockBufferLocation = 0;
boolean showDebugDisplay = false;

  pinMode(debugDisplayInPin, INPUT_PULLUP);
  // We don't have to set pin mode for analog inputs
  
  onOffSwitch.attach(onOffSwitchInPin);
  onOffSwitch.interval(switchDebounceTime);
  directionSwitch.attach(directionSwitchInPin);
  directionSwitch.interval(switchDebounceTime);
