LED Power – Device to Power Either a Red LED or a Green LED

ioledswitching

I have a green LED and a red LED. I want a sort of switch to turn either the red LED or the green LED on.
For example:

Where if the switch is off, the red LED is on but if the switch is on, the green LED is on.

enter image description here

Best Answer

A collection from another thread, posted here for the middle schematic. Pin 6 would be the GPIO pin. For better brightness matching, swap the red and green LED positions.

enter image description here