Go Down

Topic: control a led with two bush buttons (Read 182 times) previous topic - next topic

mohammedaly

hi guys i need to control a led with two bush buttons (like Debounce  example) (https://www.arduino.cc/en/Tutorial/Debounce )
but with two buttons so i can turn on or off the led with any button

pert

DON'T CROSS POST!!!!!!!!!!!!!!!!!!!!
http://forum.arduino.cc/index.php?topic=528313
I HAVE REPORTED THIS THREAD TO THE MODERATORS

Coding Badly


Wawa

hi guys i need to control a led with two bush buttons (like Debounce  example) (https://www.arduino.cc/en/Tutorial/Debounce )
but with two buttons so i can turn on or off the led with any button
Just wire the two buttons in parallel (connected to the same pin), and use the same code.
Leo..

PaulRB

If you connect the two buttons to two different pins, there is no need to debounce the buttons. Debouncing is only important when multiple presses of the same button have different actions, such as switching a led on, off, on, off or changing a mode or level, such as selecting from a menu etc.

With one button for on and one for off, multiple presses of the same button have no further effect, so debouncing is completely uneccessary.

Go Up