Recently, I needed to have a lot of digital outputs on my microcontroller. I needed more than what was available on the microcontroller and didn’t have any multiplexer nearby. After some thinking, I got the idea of using the digital pins in three states (HIGH OUTPUT, LOW OUTPUT and INPUT) instead of two (HIGH and LOW OUTPUT).
Of course, I quickly discovered that this idea is far from being an original one and is known as “charlieplexing”. Not need to go more in details as the wikipedia page has pretty much everything you need to start charlieplexing.
Thanks to charlieplexing, I could drive 8 modulated IR LEDs and 8 visible light LEDs without problem.