Pages: [1]   Go Down
Author Topic: Two different "wait" times  (Read 300 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
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?

Thanks,
Harry
Logged

UK
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.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18794
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.gammon.com.au/blink
Logged


Pages: [1]   Go Up
Jump to: