I finally tested the accuracy of delay() for 24 hours.


i have project requires alarm once day.  accuracy not critical, thought i'd test out arduino duemilanove  , see how close 24 hours long delay.  ran following command, hoping delay 24 hours:

delay(86400000);

that's 24 hours * 60 minutes * 60 seconds * 1000 milliseconds.

after 24 hours, arduino less 1 second off.  that's amazing, considering there isn't real time clock.  basic operations high precision not necessary, length of delay works well.  thought i'd pass along else considering long delays.

thats great, no 1 uses delays. experienced programmer tell never use delays throughout code, instead use millis() or micros() function keep track of time.

edit: find.


Arduino Forum > Using Arduino > Project Guidance > I finally tested the accuracy of delay() for 24 hours.


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support