Hello,
Complete newbie here. After hours and hours of reading I finally got my first skectch working and am quit impressed with myself. Well for the most part. What i'm trying to do is turn on 2 relays at a certain time. I want one to turn on and stay on then turn on another for a few minutes, then turn it off for a few minutes over and over until a certain time to shut everything off until the next day. Everything works as it should until i simulate a power outage. Depending on the time the relay may or may not start. This is the part of the code where it checks the time and where the problem is
DateTime now = RTC.now(); // Read in what our current datestamp is from RTC
if ((now.hour() >= startHour && now.minute() >= startMinute) &&
(now.hour() <= endHour))
so if I have the start time 7, 10, and end time of 22, 15 it starts on time and runs all day until the end hour, but if I cycle the power at 3, 01 it wont start back up til 10 after. I cant figure out how to tell it that a 01 now.minute is ok as long as now.hour is after the startHour
I tried using the TimeAlarm library as well but found the same issue. Im sure there a simple solution that I'm missing and maybe it would come to me if I took a break form it for a few days but thought I would ask for a bit of help first. I could live with the way it is but hate it when things don't work just right. Thanks for taking the time to help