Go Down

Topic: [BASIC] Can i use only i/o pins to light a led? (Read 407 times) previous topic - next topic

Mielp

Jul 18, 2019, 02:08 am Last Edit: Jul 18, 2019, 02:20 am by Mielp
Hi
Can I plug a led in pin 3 and 4 (with resistor) and set 4 to LOW and 3 to HIGH, will this light up the led or is it bad for the Arduino if you use an output pin as ground? And if i put them both tot HIGH, will the led go out?

Thank you!

Delta_G

Hi
Can I plug a led in pin 3 and 4 (with resistor) and set 4 to LOW and 3 to HIGH, will this light up the led or is it bad for the Arduino if you use an output pin as ground? And if i put them both tot HIGH, will the led go out?

Thank you!
You got it.  Just watch that you don't exceed the max current on an output pin. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.


Grumpy_Mike

Not sure why you would want to do this. You could do it if you had a tricolour LED with only two leads but otherwise there seems to be no need.

Do you think you are running out of ground pins? We have seen beginners think this is a problem as they don't realise you can connect more than one thing to a pin.

Mielp

#4
Jul 19, 2019, 04:23 am Last Edit: Jul 19, 2019, 04:32 am by Mielp
Not sure why you would want to do this. You could do it if you had a tricolour LED with only two leads but otherwise there seems to be no need.

Do you think you are running out of ground pins? We have seen beginners think this is a problem as they don't realise you can connect more than one thing to a pin.
It's because I didn't understand why you don't use a ground in a 8x8 ledmatrix and only i/o pins so i think I get it now? (I understand that you can't just put ground on everything on one side, every led will go on during the multiplexing) Or am I missing something?

CrossRoads

Yes, 8 pins with current limit resistors to drive anodes high, and 8 pins to drive cathodes low.
 
Multiplex with one high and one low at a time, cycle thru all 64 LEDs.

You can also drive 8 anodes  high, but then you need a transistor or a part like TPIC6B595 to sink current from all cathode in parallel, the so display can be brighter.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up