Code for Jorgen

long LengthOfYourPause;

long remTime;

 

void setup()

{

    LengthOfYourPause=5000;  //we will check every 5 seconds    

    remTime=millis();  //remember the current time

}

 

void loop()

{

    //do whatever stuff you normally do in a loop

   if(millis()>=remTime+LengthOfYourPause)
   {
        //do your led check or whatever you wanted to check here
       remTime=millis();  //reset your clock for the next time through

   }

}

I was a bit concerned about the timer rollover.

Then I looked at the arduino reference, and saw that the millis() timer wouldn’t rollover for 50+ days from a system start. :slight_smile:

Yep, I usually did this

I usually did millis() - remTime() >= Length of pause. Same thinf :slight_smile:

but now I use a single timer to handle LED stuff. Thanks CTC.