New issue
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
Add support for Alarm on DS3231 #94
Comments
Nobody responded so I'm dumping this here... Example usage... DateTime wakeTime = DateTime(rtc.now().unixtime() + (duration / 1e6L)); rtc.clearAlarm(); Coded added to RTCLib.cpp ` // Taken from: https://github.com/rodan/ds3231/blob/master/ds3231.cpp // control register // Taken from: https://github.com/rodan/ds3231/blob/master/ds3231.cpp
} // Taken from: https://github.com/rodan/ds3231/blob/master/ds3231.cpp /* control register 0Eh/8Eh // Taken from: https://github.com/rodan/ds3231/blob/master/ds3231.cpp // Taken from: https://github.com/rodan/ds3231/blob/master/ds3231.cpp // Taken from: https://github.com/rodan/ds3231/blob/master/ds3231.cpp
} void RTC_DS3231::clearAlarm(void)
} boolean RTC_DS3231::begin(void) { Code added to RTCLib.h ` class RTC_DS3231 { |
I'm ready to push my changes if someone gives me access. Otherwise, there's the code. |
Thanks for your code, that's neat, I don't know why Adafruit didn't add this to the functions. By the way, you might also be interested in this lib right here https://github.com/JChristensen/DS3232RTC; they created something similar |
@Untitled86: Have you considered making a proper pull request? |
@edgar-bonet - Thanks, I'll do that next time. |
Hello, I've moddified my RTClib.h file with your additions above. Seems simple enough. Though in RTClib.cpp I'm not sure where to copy over code. I'm assuming your RTClib.cpp is in addition to the existing code i.e. drop it in after OR Please advise |
push |
Please submit this as a PR and we'll merge it! |
I’ve added support for the alarm feature on the DS3231. I’m using that an NPN transistor and a few resistors to run the Huzzah Feather in “deeper sleep” on just 20 microamps (as opposed to 6.5milliamps with the Huzzah using the ESP’s deepsleep).
How can I share this enhancement?
The text was updated successfully, but these errors were encountered: