I made an Arduino countdown timer. With a minimum input time of an hour and maximum of 240 hours. After a bit of research I discovered using the internal clock of the Arduino isn't the most accurate or consistent (temperature changes can effect it). So I decided i'd use a DS1307 RTC module, I have the one that came in the Elegoo starter kit. However, I'm having a bit of a nightmare with what libraries to use and was wondering if anyone could recommend an example project?
I'm not sure if this is in the correct category so if you think another would suit better - please let me know.
If I remember correctly, the DS1307 does not offer an alarm interrupt. The DS3231 does have 2 alarms that can be configured. There are methods for this in the associated class
/** DS3231 Alarm modes for alarm 1 */
enum Ds3231Alarm1Mode {
DS3231_A1_PerSecond = 0x0F, /**< Alarm once per second */
DS3231_A1_Second = 0x0E, /**< Alarm when seconds match */
DS3231_A1_Minute = 0x0C, /**< Alarm when minutes and seconds match */
DS3231_A1_Hour = 0x08, /**< Alarm when hours, minutes
and seconds match */
DS3231_A1_Date = 0x00, /**< Alarm when date (day of month), hours,
minutes and seconds match */
DS3231_A1_Day = 0x10 /**< Alarm when day (day of week), hours,
minutes and seconds match */
};
/** DS3231 Alarm modes for alarm 2 */
enum Ds3231Alarm2Mode {
DS3231_A2_PerMinute = 0x7, /**< Alarm once per minute
(whenever seconds are 0) */
DS3231_A2_Minute = 0x6, /**< Alarm when minutes match */
DS3231_A2_Hour = 0x4, /**< Alarm when hours and minutes match */
DS3231_A2_Date = 0x0, /**< Alarm when date (day of month), hours
and minutes match */
DS3231_A2_Day = 0x8 /**< Alarm when day (day of week), hours
and minutes match */
};