#include <Arduino.h>
const uint8_t PINS[11] = {2,3,4,5,6,7,8,9,10,11,12};
struct Pair { uint8_t hi, lo; };
// First 44 LED pairs (you can rearrange as you wire)
const Pair LEDS[44] = {
{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10}, // 10 LEDs from pin D2
{1,0},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10}, // 10 LEDs from pin D3
{2,0},{2,1},{2,3},{2,4},{2,5},{2,6}, // 6 LEDs from pin D4
{3,0},{3,1},{3,2},{3,4},{3,5},{3,6}, // 6 LEDs from pin D5
{4,0},{4,1},{4,2},{4,3},{4,5},{4,6}, // 6 LEDs from pin D6
{5,0},{5,1},{5,2},{5,3} // 4 LEDs from pin D7
// = 44 total
};
void setHighZ() {
for (int i=0; i<11; i++) pinMode(PINS[i], INPUT);
}
void lightLED(Pair p) {
setHighZ();
pinMode(PINS[p.hi], OUTPUT);
pinMode(PINS[p.lo], OUTPUT);
digitalWrite(PINS[p.hi], HIGH);
digitalWrite(PINS[p.lo], LOW);
}
void setup() {}
void loop() {
for (int i=0; i<44; i++) {
lightLED(LEDS[i]);
delay(50); // test: lights each LED one by one
}
}