I'm looking to trigger events at certain times of the day using a DS3231 RTC attached to a Uno.
I know about the alarm function/interrupt built into the RTC but the limitation is there's only space for 2 and I'd like 4 or 5 throughout the day.
I'd like to be able to trigger events at times set in my code which will run in a loop continuously. They don't need to be milisecond accurate, I can't use millis as the drift is too much and a reset would then not have accurate time of day (if the RTC was not included)
It only needs to have 24hr functionality as I want the triggers at the same time every day. I don't need day of the week functionality.
I assumed I could write an if statement that went something like.
if (time >= 0600);
event = true
I can't seem to find anywhere any resources where the RTC sets the Arduino time, then where I can compare the current time (or time variable) with my if statement.
A point in the right direction would be very much appreciated.
He means save the on/off state so that you can turn it off when you are finished with it, or else it will repeatedly trigger for a whole minute. You would also have to test the state to use that.