sleemanj / DS3231_Simple

An Arduino Library for EASY communication with DS3231 I2C RTC Clock and Atmel AT24C32 I2C EEPROM commonly found on the same board. Implements setting, getting the time/date, setting, checking and clearing alarms, and dead-easy circular-buffered logging of data with timestamp.
MIT License
82 stars 25 forks source link

How can i set alarm like 19:03:00 everyday #18

Closed hcjplj closed 5 years ago

hcjplj commented 5 years ago

first, Thank you to your library

I want to set alarm like 19:03:00 and 19:05:00 everyday

I want to turn on servo motor 1 at first alarm and turn off at second alarm

Could you show me how to set alarm at special hour, minute, second? How can i change this code?

` DateTime MyTimestamp = Clock.read();

// We want the alarm at this second MyTimestamp.Second = 30;
MyTimestamp.Minute = 3;

// And now add the alarm to happen when the second matches Clock.setAlarm(MyTimestamp, DS3231_Simple::ALARM_MATCH_SECOND); Clock.setAlarm(MyTimestamp, DS3231_Simple::ALARM_MATCH_MINUTE_HOUR); `

sleemanj commented 5 years ago

Please read comments at bottom of https://github.com/sleemanj/DS3231_Simple/blob/master/examples/z2_Alarms/Alarm/Alarm.ino which explains how the alarms function.