Hardware Reference
In-Depth Information
Charlieplexing 20 LEDs using 5 ATTiny85 pins with fading by
varying the duty cycle of each LED in the 'tail'.
ATTiny85 connections
Leg Function
1 Reset, no connection
2 D3 GREEN
3 D4 ORANGE
4 GND
5 D0 WHITE
6 D1 BLUE
7 D2 YELLOW
8 +5V
Tested on ATTiny85 running at 8MHz.
*/
//// Each block of 4 LEDs in the array is groupled by a common anode
(+, long leg)
//// for simplicity of wiring on bread board, using a color code
#define GREEN 0
#define ORANGE 1
#define WHITE 2
#define BLUE 3
#define YELLOW 4
//// Pin definitions {GREEN, ORANGE, WHITE, BLUE, YELLOW}
const int charliePin[5] = {
3, 4, 0, 1, 2};
//// Charlieplexed LED definitions (current flowing from-to pairs)
const int LED[20][2] = {
{
ORANGE, GREEN }
, //// 0 (GREEN GROUP)
{
WHITE, GREEN }
, //// 1
{
BLUE, GREEN }
, //// 2
{
YELLOW, GREEN }
Search WWH ::




Custom Search