Intro: Charlieplexing
![](img/projects/week11/charlie1.png)
This week we had to play with output devices. I knew what I wanted to do right from the first day: Charlieplex an 8x8 RGB LED matrix! If you actually make the calculations the resulting number of LED's needed to be addressed are: 192!! Thankfully, due to a guy named Charlie Allen there is a technique to address those LED's using only 19 pins! This technique The method uses the tri-state logic capabilities of microcontrollers in order to gain efficiency over traditional multiplexing.
The trick is that if you change the directionality of a single pin, it can act both as an anode and a cathode for an LED. Moreover, the tri-state has a very high impedence so the pin is like being totally disconnected. To simplify the design of the charlieplexed pins, I made the matrix you can see on the right. Each column and row number represents a pin. Each pin is written two times because it can act both as an anode (columns) and a cathode (rows). In the produced array, I can place each LED either horizontally or vertically, depending on whether the LED's I use are common anode or common cathode. The diagonal of the matrix is black because I cannot connect both the anode and cathode of an LED to the same pin as it will short-circuit.