Startup animation iterates in pixel pairs (0+1, 2+3, ..., 8+9)

This commit is contained in:
ash
2026-07-03 08:41:26 +00:00
parent 88fee54f96
commit 39326e3247
+10 -6
View File
@@ -194,21 +194,25 @@ void DefaultLedStub::begin() {
return; return;
} }
Serial.println("[LED] Launchpad-style startup animation..."); Serial.println("[LED] Launchpad-style startup animation (paired)...");
// Launchpad X style: sweep each LED through palette, then all-off // Sweep each pixel-pair through palette, then off
for (int i = 0; i < NUM_LEDS; i++) { for (int pair = 0; pair < 5; pair++) {
int i1 = pair * 2;
int i2 = pair * 2 + 1;
for (int c = 1; c <= 127; c += 8) { for (int c = 1; c <= 127; c += 8) {
uint32_t color = launchpad_palette[c]; uint32_t color = launchpad_palette[c];
uint8_t r = (color >> 16) & 0xFF; uint8_t r = (color >> 16) & 0xFF;
uint8_t g = (color >> 8) & 0xFF; uint8_t g = (color >> 8) & 0xFF;
uint8_t b = color & 0xFF; uint8_t b = color & 0xFF;
mux_ptr->set_led_color(i, r, g, b); mux_ptr->set_led_color(i1, r, g, b);
mux_ptr->set_led_color(i2, r, g, b);
mux_ptr->show(); mux_ptr->show();
delay(15); delay(15);
} }
// Turn off this LED before moving to next // Turn off this pair before moving to next
mux_ptr->set_led_color(i, 0, 0, 0); mux_ptr->set_led_color(i1, 0, 0, 0);
mux_ptr->set_led_color(i2, 0, 0, 0);
mux_ptr->show(); mux_ptr->show();
} }