I have an "Adafruit DS3231 Precision RTC" (ID 5188).
Is there a reliable way to determine whether the device's clock has been set?
For example, suppose the device loses power, is there a status indicator somewhere which would indicate that the clock is no longer valid?
I think that device's clock defaults to sometime "a long time ago" so reading the clock and comparing the result to a known recent time value can work but this seems a bit clumsy.
Thank you,
Larry
Adafruit DS3231 Precision RTC - detecting unset clock
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- ldauton
- Posts: 21
- Joined: Fri Oct 07, 2022 7:57 am
- dastels
- Posts: 15831
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Adafruit DS3231 Precision RTC - detecting unset clock
See the ds3231.ino example for the Arduino library. Specifically you use:
In CircuitPython you can use .
Dave
Code: Select all
rtc.lostPower()
Code: Select all
rtc.lost_power
Dave
Please be positive and constructive with your questions and comments.