Hello everyone, I am creating a project in which I activate 2 relay to turn on two water pumps, the question is: I need that to activate the relay the button in the application has to be pressed for 3 seconds, it is to prevent someone accidentally turn it off or turn it on with a touch, could someone tell me how to implement this function? Thank you.
HI, this might work . . .
- Check the state of the button (pressed or not-pressed)
- Start a three second timer
- When the timer finishes check the state of the button again
- If the button is still pressed after three seconds then activate the relay
Remember, don’t use delay() for your timer, Blynk doesn’t like delay(), use millis()
Good luck
billd
A long discussion on the subject, along with some potential solutions, in this topic…
Pete.