can I drive LED's on digital pins?

Wanted to use the digital pints to drive LED's, on pin 13 I can but on the other pins (didn't try them all...) it doesn't work. Any tips?

Yes, you can drive standard leds from digital output pins provided you wire them with a properly sized series current limiting resistor to limit the current so as not to burn out the output pin. Then you need to write the proper pinmode statements to put the desired pins into output mode and then write the desired high or low output value.

If you get stuck post your wiring drawing and sketch coding.

Lefty

A 270? resistor will be safe for most LEDs. The longer lead of the LED is the positive end.

Wanted to use the digital pints to drive LED's, on pin 13 I can but on the other pins (didn't try them all...) it doesn't work. Any tips?

There's no reason that pin 13 will work and the others won't. It's got its own LED that would be in parallel with yours, but otherwise the pin is the same as all the others as far as normal I/O is concerned. Perhaps you could post the code that you are using.

Don

In addition to using current limiting resistors (do not ignore this advice), make sure you set each pin's PINMODE to output.

Hi, thanks, setting the pinmode to output did the trick :slight_smile:

setting the pinmode to output did the trick

Certainly you meant: "setting the pinMode to output AND using current limiting resistors did the trick."

What value of resistor did you decide on using?

Of course, I now use 270 ohm, as suggested. Easy, but you just need to know.

asterixa: Hi, thanks, setting the pinmode to output did the trick :)

Yes ... that proves a discussion some of us had in another thread looong time ago: The Arduino startup code (possibly the hardware itself) sets all pins to INPUT except pin13 which is set to OUTPUT.

The Arduino startup code (possibly the hardware itself) sets all pins to INPUT except pin13 which is set to OUTPUT.

It's the hardware, a reset defaults all I/O pins to input mode. Bootloader would then run and set-up some pins as it wishes and then when jumping to a preloaded sketch further modifications will be done.

Lefty