I once saw somewhere that it is possible to control 3 LEDs with 2 IOs and only using LEDs and resistors. The high state is 5v and low state is 0v.
With 2 digital IOs, we can have 4 different possible situations for LEDs.
00 -> all off
01 -> LED1 on, others off
10 -> LED2 on, others off
11 -> LED3 on, others off
So it is logically possible using logical gates and mixing them. but How could it be done only with resistors and LEDs? and I am sure this method exists.
If they were 2 It was so easy. we connected them the in opposite to each other in parallel with a series resistor and 01 would light the first one and 10 would light the other one. like this :