Go Down

Topic: Did the LED pin 13 should be on in all the codes??? (Read 434 times) previous topic - next topic

MRLUCKY

Hello, I got my Arduino uno r3 and as usual I started with the blank example and every thing works fine, but when I use the servo code example (sweep) I notice that the pin 13 led work contenus (not blanking).

so is it usual that this led works with every code even if there is no setup for it????     

btricha2

The LED only blinks if you tell it to turn on, then turn off.

I don't think there is anything telling the LED to blink in that code, so it should not be blinking.

If you set the LED (pin 13) to "HIGH" it will stay on and not blink, otherwise it shouldn't blink

Nick Gammon

I think the bootloader might leave pin 13 turned on. You can always turn it off in your code.
http://www.gammon.com.au/electronics

MRLUCKY


I think the bootloader might leave pin 13 turned on. You can always turn it off in your code.


Oh, I think thats make sense because I didn't put a code thats make the led high.

I'm I right???

Nick Gammon

http://www.gammon.com.au/electronics

CrossRoads

If pin 13 is left as an input, the pin could float and trip the comparator, so the LED could turn on.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up