Closed tkt8 closed 5 years ago
Have you output the state of buttonIsPushed
when it is being evaluated at this line? Is it actually true
?
It keeps toggling. Have tried changing the button also to no avail
I would avoid using the delay()
command if possible. That will stall the running loop()
, which can make the operation of the device "clunky". Do you need all of those 1 sec delays?
That was just to visualize the serial monitor status. Will remove them just in case and try.
Found out the reason it was toggling. Code is working now. Thanks
Can you please help me with the code? On line 37 the flow is passing through the if even when the button is not pressed and the operating mode keeps toggling continuously. I cannot figure out why.