adafruit / RTClib

A fork of Jeelab's fantastic RTC Arduino library
MIT License
798 stars 709 forks source link

DS3231: Add support for fetching alarm enabled status #269

Open justinnewitter opened 1 year ago

justinnewitter commented 1 year ago

This commit introduces one new method for DS3231 devices:

Updated the DS3231_alarm example to fetch the alarm1 enabled status. Locally validated that this correctly fetches the enabled/disabled status for alarm2 as well.

Sample output from the DS3231_alarm example

22:43:32 [Alarm1: 20 22:43:36, Mode: Second, Enabled: 1, Fired: 0
22:43:34 [Alarm1: 20 22:43:36, Mode: Second, Enabled: 1, Fired: 0
22:43:36 [Alarm1: 20 22:43:36, Mode: Second, Enabled: 1, Fired: 1 - Alarm cleared
22:43:38 [Alarm1: 20 22:43:36, Mode: Second, Enabled: 1, Fired: 0
22:43:40 [Alarm1: 20 22:43:36, Mode: Second, Enabled: 1, Fired: 0

The Enabled: 1 is what is new 😄