We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I notice there is some weirdness when using the setMinutes, setHours functions.
Using the function rtc.setHours(rtc.getHours()+1);
rtc.setHours(rtc.getHours()+1);
allows for setting time between 0 and 32. Shouldn't this wrap around at 24?
Code example:
#include <RTCZero.h> RTCZero rtc; void setup() { rtc.begin(); // initialize RTC } void loop() { Serial.print(rtc.getHours()); Serial.print(":"); Serial.print(rtc.getMinutes()); Serial.print(":"); Serial.print(rtc.getSeconds()); Serial.println(); rtc.setHours(rtc.getHours() + 1); delay(1000); }
Output
18:05:33 19:05:34 20:05:35 21:05:36 22:05:37 23:05:38 24:05:39 <-- Not a valid time 25:05:40 26:05:41 27:05:42 28:05:43 29:05:44 30:05:45 31:05:46 00:05:47 01:05:48
The text was updated successfully, but these errors were encountered:
Hello @jacky4566, Can you please test and tell me what happens when you pass a value of more than 32?
Sorry, something went wrong.
No branches or pull requests
I notice there is some weirdness when using the setMinutes, setHours functions.
Using the function
rtc.setHours(rtc.getHours()+1);
allows for setting time between 0 and 32. Shouldn't this wrap around at 24?
Code example:
Output
The text was updated successfully, but these errors were encountered: