Arduino_Buzzer_Millis question

don't you want the code to periodically turn on the relay, every second. and you want it turned off some time after it is turned on.

so interval1 should be 1000 if you want it to do something every second (why 1000 -337)?

when interval_2 expires, Millis2 should be reset.

and prevMillis1 should also be be reset to currentMillis so it expires after interval_1.

but once Millis1/interval-1 expires, you don't want it executing again until after interval1 expires.

the timers are not independent

1 Like