

Without trying to work increments and counting millis() from start and always working from that, its pretty accurate. These are long term tests, the slighty oddball way it increments millis can put it out in the short term.


Of course the Arduino CPU clock is only good to about ten minutes a day accuracy so you'll be off pretty far by the time you need to worry about rolling over.ĭepends on the Arduino and the coding, I have a couple of Duemilanoves that keep better time than the watch on my wrist (gain around half a second a day). So when does the millis() function overflows? unsigned long days =currentTime / 86400000 This is the scetch from 0022 IDE running on an UNO #include Įxtern volatile unsigned long timer0_millis From general reading on the old forum I was 99% certain that arduinos millis() function would overflow every 9.5 hours or so but mine is still correctly counting for the last 23 hours. I wanted to make a timer with my LCD so i drafted an early scetch to test its practicality.
