Go Down

Topic: Code for button press detection (Read 472 times) previous topic - next topic

harshvardhan


Normally, button presses go from HIGH to LOW (switch contact to gnd) - Looks like you're running LOW to HIGH




could u please ellaborate on that
and yes, my switch normally passes no current (atleast thats how i planned it to be), if i press, the circuit is completed

Arrch

#6
Jan 21, 2013, 05:54 pm Last Edit: Jan 21, 2013, 05:56 pm by Arrch Reason: 1
Your input pin is floating then. You need to enable the internal pull-up resistor so that when the switch is open, the input will read HIGH. You also need to modify your circuit so that pressing the button will connect the input pin to GND.

PaulS

What is connected to pin 8? A complete diagram, please.

What you have sounds a lot like a floating pin condition, caused by not using proper pullup or pulldown resistors.

Go Up