Naguissa / uRTCLib

Really tiny library to basic RTC functionality on Arduino. DS1307, DS3231 and DS3232 RTCs are supported.
https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html
GNU Lesser General Public License v3.0
87 stars 24 forks source link

example for alarms #20

Closed roblatour closed 4 years ago

roblatour commented 4 years ago

First, thank you for this library - appreciate the effort that you have put into it.

I see there was a closed issue already looking for an example of how to use the alarms. You have noted that alarm support has been added, but the full example only shows how to set an alarm, not how to react to it. Most importantly, how to set (or understand) the pin used to determine if the alarm is active or not.

adding a more detailed example would be very helpful.

Naguissa commented 4 years ago

Added an example and created 6.2.9 release.

You can see connections here: https://raw.githubusercontent.com/Naguissa/uRTCLib_doc_and_extras/master/imgs/deepsleep_connection.png

You need a 10uF capacitor.

See added example (uRTCLib_deepsleep) to view details.

Currently tested on Arduino nano v3, but should work on ES8266 and ESP32.

Naguissa commented 4 years ago

Oh! If you only want to detect the alarm it's quite easy:

SQWG outputs VCC on normal state and drops to GND when alarm is active (programmed, event happened and you haven't cleared it).

You can connect it directly to any microcontroller pin.