Hello,
I'm sure this has been answered before but I couldent find a clear answer on here. Please redirect me if you know of a previous thread.
I hooked up a rtc and its running fine. My question is how to set up duration events given that it's not a continuous output like millis(). I can use millis()-stampedtime>= 3000 for example to have something happen for a 3000 ms duration.
My best thought was to have t.sec (second output 0-59 from the rtc) checked and if different from last check then to increment a variable by 1. Once this variable == 3 then three seconds would have passed and the action would take place.
Is this the best way or?
Thank you
If(t.hour==17){
If(t.min==15){
If(t.sec>=0){
Do action;
}}}
I know these are generally library specific, but isnt there usually a compound (parsed) way of checking and comparing the time in a single function ?
Pseudo example
If(time==17.15.00){
Do Action;
}
Also if I write it as
If((t.hour==17) && ( t.min==15) && (t.sec>=0)){
Do action;
}
It doesn't function. Do if functions have a limited number of arguments?