i am monitoring a relay I/P which is flickering as utilty power is not stable in this area. i need to know when I/P is off for more the 2 mins. if I use delay(***) it slows program down. and works eratically
So what i need is a Off Delay, so if I dont see input for more then 2 mins my program then runs.
Here is code
https://pastebin.com/qx0162ss
thanks for any help
2 Answers
Hi.
Instead of delay, you can use milis() to count the time without blocking your code.
If you’re new to this concept, I recommend taking a look at this tutorial: https://forum.arduino.cc/t/using-millis-for-timing-a-beginners-guide/483573
I hope this helps.
Regards.
Sara