Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DS3231_set.pde was using the word day and the word date where it should have always been the word date. It was not setting the day at all, but leaving it at zero. This has been fixed. Also re-named variables to follow proper case convention in the same sketch. Set all Serial.begin statements to initiate at 57600. Some examples wre starting at 57600 and others at 9600. Now they are consistent. And in reference to your comment in DS3231.cpp where you mention the fact that if someone does a setClockMode at the right millisecond, it will set the clock back by an hour ... here is a proposed solution, which I know is not perfect, but I only wrote it to illustrate one possible way of dealing with that scenario: This would go towards the top of the setClockMode method. bool h12Flag = false; bool pmFlag = false; byte h = getHour(h12Flag,pmFlag); byte m = getMinute(); byte s = getSecond(); int diff = 59 - s; if (h == 11 || h == 23) { if (m == 59) { if (diff <= 3) { delay(3500); } } } All it does is check to see if the clock is close to that moment, then if it is, it simply waits to make sure that moment has passed before issuing the setting.
- Loading branch information
1 parent
cb32a5c
commit 5495bba
Showing
3 changed files
with
98 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters