Skip to content

Commit fc1b848

Browse files
committed
fix(ds3231): correctly enable alarms in example
1 parent 4b0b841 commit fc1b848

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/ds3231/alarms/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ func main() {
2727
if err := rtc.SetAlarm1(time.Date(0, 0, 0, 0, 0, 59, 0, time.UTC), ds3231.A1_SECOND); err != nil {
2828
fmt.Println("Error while setting Alarm1")
2929
}
30-
if err := rtc.EnableAlarm1(); err != nil {
30+
if err := rtc.SetEnabledAlarm1(true); err != nil {
3131
fmt.Println("Error while enabling Alarm1")
3232
}
3333

3434
// Set alarm2 so it triggers when the minutes match 35 => repeats every hour at dd:hh:35:ss
3535
if err := rtc.SetAlarm2(time.Date(0, 0, 0, 0, 35, 0, 0, time.UTC), ds3231.A2_MINUTE); err != nil {
3636
fmt.Println("Error while setting Alarm2")
3737
}
38-
if err := rtc.EnableAlarm2(); err != nil {
38+
if err := rtc.SetEnabledAlarm2(true); err != nil {
3939
fmt.Println("Error while enabling Alarm2")
4040
}
4141

0 commit comments

Comments
 (0)