Pages: [1]   Go Down
Author Topic: Two different "wait" times  (Read 310 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?


Offline Offline
Shannon Member
Karma: 223
Posts: 12630
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Global Moderator
Offline Offline
Brattain Member
Karma: 499
Posts: 19075
Lua rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pages: [1]   Go Up
Jump to: