0

millis() error after about a 24 hours
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

millis() error after about a 24 hours

by Stateradio on Sun May 02, 2021 6:55 pm

Hello,
I have a project using a neopixel ring where the light advances as to a certain amount of time elapsed using millis().
It works perfectly for about a day, maybe a little more, then it gets totally out of whack!
(It's not just a slow inaccuracy that is more apparent after time, it is way off all of a sudden.)
It's happened with both a Metro Mini and a Trinket.
I kept it plugged into my computer so I could check the serial monitor and confirmed it was perfect for at least a day, then was suddenly off.

Is there something I'm missing regarding using millis()? I thought it should be good for something like 50 days!
Thanks for any help!

Stateradio
 
Posts: 25
Joined: Sun Apr 05, 2015 9:50 am

Re: millis() error after about a 24 hours

by dastels on Sun May 02, 2021 7:33 pm

That's a common approach to timed events. What exactly happens? "totally out of whack" and "it is way off all of a sudden" tell me nothing.

Dave

dastels
 
Posts: 6513
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.