I am very very new to arduino and electronics ...
I am trying to replicate this tutorial
"
"
but using a different pin to connect the led.
My problem is, because they use the embeded led in this example, the led and it's resistor do not appear in the schematic. I have tried to connect a led exactly like in this other tutorial ( http://arduino.cc/en/Tutorial/Blink )
So basically I just "merged" these two schematics together ... but as you may guess it doesn't seem to be so simple.
the button does nothing and the led stays on forever ...
What am I doing wrong ? ( assuming you understood my problem ... )
So you want to combine the two?
Connect the push button between pin 2 and Gnd, use the internal pullup resistor instead. The pin will be High when the button is not pushed, and Low when it is pushed.
Connect the LED anode to pin 12, cathode to resistor to Gnd.
It works ^^ thank you very much .
I think, my mistake was to plug the button to the 5v pin, like in the tutorial.
that wasn't so difficult indeed, but remember I am very very new to this ^^
Yes, connecting buttons/switches to +5 is not a good practice. We’ve seen lots of cases where folks shorted 5V to Gnd and either damaged the power supply or the power loss made the board reset. Connecting an input to Gnd never hurt anything.