The experiment was to see how quickly I could charlieplex 2 x 3-led bar displays and drive it with a Raspberry Pi (2). Breadboarding was fairly simple - figuring it out on Fritzing took longer!
The Raspberry Pi is mounted on the "official" touchscreen (which is not being used here) and is running from a 20Ah LiPo pack.
- Raspberry Pi (model not important)
- 2 x MU04 Light bars
- MU04-2101 Red
- MU04-4101 Yellow-Green
- 3 x 220 ohm resistors
The MU04 units are now obsolete and there's not even a Fritzing image for any of them. I replaced the LED bar with 3 discrete LEDs in the Breadboard image.
Original diagram inspiration:
Original code inspiration: Github: raspberrypi_cookbook_ed2/charlieplexing.py by Simon Monk
Development from SM's code:
- Constants used in the pin_led_states table. This makes it more clear that the pins are tri-state with values: HI, LO, and INput mode.
- Converted to Python3
- Wrapup code added to respond gracefully to Ctl-C or a kill signal.
- LED display closed down before program termination with the clear_pins function
Ron
April 20, 2017