I am trying to get a timer to work using millis, when I run this in the Main Loop, the LED turns on (Gator+ board so LED inverted), runs for 10 seconds then turns off.
So the while statement is working, but why doesn't the LED blink?
if (serviceBypassTrigger == HIGH ) //let system open and close doors while error is live
{
unsigned long errorClockStart = millis() + 10000;
unsigned long errorClockCount = 0;
while (errorClockCount < errorClockStart)
{
errorClockCount = millis();
It is allways better to paste the complete code because that makes it often much simpler to find bugs. This one is fairly easy, it will blink but you don't see it. After the errorled is made HIGH it is almost immediately made LOW again as there is no delay after the HIGH. Try this: