Go Down

Topic: Two different "wait" times (Read 426 times) previous topic - next topic


Newbee programming question: I want one thing in my sketch to run every 5 minutes and another thing run every 30 seconds. If I use the wait function, the program just stops for that period of time without doing anything else. What would be the appropriate way to handle the two timing issue?



By 'wait' I assume you mean delay().

Look at the 'blink without delay' example sketch for a demonstration of how to carry out one timed activity while enabling the sketch to carry on doing other things. You can use this approach to support as many different activities as you like.
I only provide help via the forum - please do not contact me for private consultancy.

Nick Gammon

Please post technical questions on the forum, not by personal message. Thanks!

More info:

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131