I have been trying to make a program where I press a button and the LED will come on, but when I upload it the LED is already on without pressing the button, and when I press it it flashes then comes on again.
Here is the code
I have been trying to make a program where I press a button and the LED will come on, but when I upload it the LED is already on without pressing the button, and when I press it it flashes then comes on again.
Here is the code
Please post your code. Please post a diagram how everything is wired (photo/scan of a hand drawn one is fine).
It sounds like floating inputs.
make sure there is a resistor attached to the LED or you might fry your arduino and/or the LED