johnny78
Full Member level 5
hi Guys
im working on a timer project using Arduino & ds1307RTC 24h mode
my code is working great for starting & stopping the desired output
BUT my brain stopped working when i thought of the hour 23:59
any idea to correct my code?
its ok for time between 00:00am - 23:59pm
but how to solve it for the time after 23:59
thanks in advance
Johnny
im working on a timer project using Arduino & ds1307RTC 24h mode
my code is working great for starting & stopping the desired output
BUT my brain stopped working when i thought of the hour 23:59
Code:
if ((out1TimeControl) == 0 && (settingsDisplay1) == 0) {
if ((tm.Hour) > out1OnTimeSetHours) {
if ((tm.Hour) <= out1OffTimeSetHours) {
out1TimeControl = 1;
}
}
if ((tm.Hour) >= out1OnTimeSetHours && (tm.Minute) >= out1OnTimeSetMinutes) {
if ((tm.Hour) <= out1OffTimeSetHours) {
if ((tm.Minute) <= out1OffTimeSetMinutes) {
out1TimeControl = 1;
}
}
}
}
if ((out1TimeControl) == 1 && (settingsDisplay1) == 0) {
if ((tm.Hour) >= out1OffTimeSetHours) {
if ((tm.Minute) >= out1OffTimeSetMinutes) {
out1TimeControl = 0;
}
}
}
its ok for time between 00:00am - 23:59pm
but how to solve it for the time after 23:59
thanks in advance
Johnny