// Icesythe7 - 2/23/26 1:53AM
// can rotate thru the bits like so
const uint8_t ledPins[] = {2, 3, 4, 5};
constexpr uint8_t NUM_LEDS = sizeof(ledPins) / sizeof(ledPins[0]);
uint8_t leds_active = 0x01;
void setup() {
for (uint8_t i = 0; i < NUM_LEDS; i++) {
pinMode(ledPins[i], OUTPUT);
}
}
void loop() {
for (uint8_t i = 0; i < NUM_LEDS; i++) {
digitalWrite(ledPins[i], (leds_active >> i) & 0x01);
}
leds_active <<= 1;
if (leds_active == (1 << NUM_LEDS)) {
leds_active = 0x01; // wrap
}
delay(200);
}