Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Circuitpython long timer events
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Circuitpython long timer events

by rdevries on Fri Jun 12, 2020 11:14 am

I require few long timer events in my project.
These events are independent from each other and could be required to run up to 3Hrs.
Looking at the time library https://learn.adafruit.com/arduino-to-circuitpython/time, it says that anything longer than an hour could lose time.
How much time could be lost over 3 hours? few milli secs?
Can CP access registers on the micro? (M4 Express) then setup a timer for what is required?

rdevries
 
Posts: 20
Joined: Wed Mar 02, 2011 12:04 am
Location: On. Canada

Re: Circuitpython long timer events

by tannewt on Fri Jun 12, 2020 12:00 pm

We don't currently expose registers directly.

You can use `time.monotonic_ns()` to get a value that isn't packed into a float. That should make the accuracy consistent. An external RTC will be more precise though.

tannewt
 
Posts: 1685
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.