I'm looking for a methodology to adjust the time in the RTC of the Data Logger Shield (DLS) after it has been set. For example, on a regular interval (whether that be once a day or every 4 hours) I want the DLS to connect with an NTP site or another computer, get the current time, and compare the time with the RTC time. It the time is within a standard difference (say less than a second) do not update the RTC, and if outside of the standard difference (more than a second) then update the time on the RTC.
I would appreciate any help with this topic. Thanks in advance!
Adjusting time in RTC on Data Logger Shield
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15656
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Adjusting time in RTC on Data Logger Shield
It looks like you just need to call adjust on the RTC object with the new time/date. See https://learn.adafruit.com/adafruit-dat ... time-clock You'll also need a network connection for fetching the time.
That said, the idea of using an RTC is to not need to regularly check a time server. Which is exactly what you want for a datalogger using local storage.
Dave
That said, the idea of using an RTC is to not need to regularly check a time server. Which is exactly what you want for a datalogger using local storage.
Dave
Please be positive and constructive with your questions and comments.