Skip to main content
6 events
when toggle format what by license comment
Feb 18, 2018 at 23:07 comment added Chris Stratton This is a bit misleading. There's nothing wrong with the way the button is wired in the question; it may be unecessary to use an output for the low side of the button, but it is entirely workable, and that output is driven low.
Dec 21, 2017 at 4:24 comment added Nouman It is not working as I expected , if I increase the time in delay in the code, the button will not work when it is pressed during delay.
Dec 20, 2017 at 22:17 comment added Holmez @J.Doe I have struck that through, as you were right about that bit. The rest of the answer still stands though, and should provide the solution to your problem.
Dec 20, 2017 at 22:14 history edited Holmez CC BY-SA 3.0
changed digitalRead(output) to digitalRead(input)
Dec 20, 2017 at 13:46 comment added Nouman your using in INPUT_PULLUP, your button will read HIGH when the button isn't pressed, but will continue to read HIGH even after the button is pressed - which leads to the second issue of your first while loop - because mode is initialised to 0, and the button is always reading HIGH, the condition for your while loop will always be true, consequently, the loop will never exist. .... it will read zero after I press the button , looks like you have not tested the code.
Dec 20, 2017 at 11:23 history answered Holmez CC BY-SA 3.0