Hi everyone, I need to connect two leds in parallel but using two pins (each pin power one led), so when one is on the other will be off.
Like this image:
Hello LuanGuilherme,
Welcome to the Arduino forum.
Erm, was there a question?
What you propose will work but I have no idea why you want to do it that way or what you are asking.
As a non-native english speaker I have some communication problems.
My question: Is it possible to control the leds separately in the way they are in the image (same line of the breadboard)?
As a non-native English speaker
It never crossed my mind that English was not your first language, there are a lot of native speakers whose English is worse than yours!
Is it possible to control the leds separately in the way they are in the image
Yes. However be aware that with 1 resistor shared between them if you put both on at the same time they will be dimmer than if you have 1 on at a time. It's also possible if they are different colours that if you put both on only 1 will light. Try it and see, you won't break anything.
I get that you are new to this but really that's the kind of thing you can just try to see what happens, no need to ask, just do it.
I'm assuming that putting both wires into the same hole on the breadboard is a mistake in the drawing, they won't fit, or if they do you might damage the board.
PerryBebbington:
I'm assuming that putting both wires into the same hole on the breadboard is a mistake in the drawing, they won't fit, or if they do you might damage the board.
It's worse than that, Jim!
You are showing two LEDs connected to the same two rows in the breadboard, so they would be connected directly in parallel. You then have two Arduino pins connected to the same row so if one is HIGH and the other LOW, they would be shorting out.
So "Try it and see, you won't break anything" is in fact, not correct at all!
Each LED must span two rows (if a "row" is that group of five sockets which are the same connection, horizontal in this illustration) , but a different two rows for each LED.
The comments regarding sharing one resistor are entirely correct.
Well that's embarrassing Paul B! I looked at the diagram several times and didn't notice the short between the 2 outputs where they join the LEDs.
Based on what I thought I saw, separate wires to the LED anodes, with no short, then I stand by my comments. Based on what Paul B saw that I missed, that the outputs are shorted at the LEDs, then Paul B is correct, don't do that.
Connect each output separately to each LED, join the cathodes together and the resistor and try it.
Paul B ++Karma for seeing what I missed
I need to connect two leds in parallel but using two pins (each pin power one led), so when one is on the other will be off
So are you not rich enough to afford an other of those $0.01 resistors?