-
Couldn't load subscription status.
- Fork 717
Description
Is there any interest in adding the read/write of DS3231 aging register (register 0x10) to the RTClib codeset ?
I have prepared a working (and tested) form using release RTClib v2.1.4 that I'm happy to share.
Changes made are contained in the following files:
RTC_DS3231.cpp
RTClib.h
Target system is Arduino MEGA, so the AVR systems like MEGA and NANO etc.
-
Arduino board: Arduino MEGA
-
Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.19
-
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too):
Not really relevant as the RTClib codeset does not currently have handlers for reading or adjusting the RTC DS3231 aging register, but as a code snippet, please look at the following sample project file lines:
int8_t prevDrift=rtc.get_aging(); //to read the aging register value
rtc.set_aging(newDrift); //to set a new value to the drift register, eg -17, and thus refine the RTC clock drift (speed up the clock by using -ve numbers in ppm, or slow down using +ve numbers).
Code changes came from DS3231 library, written by Petre Rodan in 2018 and modified to suit your library.
The reason why I changed to your code; you have a working UNIX seconds counter, so for me, that's a big tick.