Charlieplexing is a multiplexing technique for driving LED’s using fewer IO pins.  You can use it to control N*(N-1) LED’s where N is the number of IO pins that you are using.  It works because the IO pins on a microcontroller have three available states.  If the pin is set to output then it can output a 1 or 0.  The third state is input, where the pin is set to high impedance and is effectively disconnected from the circuit.

 

This is the example circuit from the Wikipedia entry referenced above.  There are three pins being used to drive six LED’s.  Two pins have to be set to output, one high and one low, and one pin has to be disconnected from the circuit in order to address an LED.

 

 

 

Here is the example circuit on my breadboard.  It’s being driven by a TI MSP430.

I found that the quickest way to make it work was to set all the pins so that they were inputs, then override the two that I needed as outputs and finally set the one pin that I wanted to output a 1.