Go Down

Topic: Button and LED problems (Read 850 times) previous topic - next topic

sora628

Hi all, I've been messing around with some examples recently, and I decided to look at the "button" example so I could incorporate it into my AGV.  I'm having what appears to be a static electricity problem.  Whenever I come within 2 inches of the wire that connects the Arduino to the button, the LED automatically lights up.  When I go to press the button, the LED turns off.  And here's another weird thing that's happening--When I go to push the button with a solid wooden ruler, the LED stays off when I push the button.  I'm 99.99% positive I have the wiring correct.  Can anyone help me here?

fungus


Hi all, I've been messing around with some examples recently, and I decided to look at the "button" example so I could incorporate it into my AGV.  I'm having what appears to be a static electricity problem.  Whenever I come within 2 inches of the wire that connects the Arduino to the button, the LED automatically lights up.  When I go to press the button, the LED turns off.  And here's another weird thing that's happening--When I go to push the button with a solid wooden ruler, the LED stays off when I push the button.  I'm 99.99% positive I have the wiring correct.  Can anyone help me here?


What's your code?

Advanced Arduino

johnwasser

The "lights when I approach" problem sounds like a floating input. When the button is open the input pin has to be connected to ground or +5V with a resistor. If not, the input will read random static.

Check your wiring again.  Compare it to the tutorials.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

sora628

didn't realize i was missing my ground and resistor to the button....sorry about that!! that was silly of me

Go Up