Red or green LED, with one GPIO on MCU?

ApacheKid

Joined Jan 12, 2015
1,533
View attachment 196351

There is absolutely nothing wrong with this circuit.
It has the advantage that you can have both LEDs turned on at the same time by configuring the GPIO as input.

There is no problem with the fact that the circuit will be drawing current. One LED has to be on all the time.

You can do the same thing with a dual red/green LED between the GPIO pin and a 2-resistor voltage divider.
View attachment 196366
Yes, you're right that circuit isn't a problem.
 
Top