From 835e30b8b146b918392064abd057844da628fca6 Mon Sep 17 00:00:00 2001 From: Ashley Strahle Date: Tue, 23 Jun 2026 22:24:28 +0000 Subject: [PATCH] Add anim command to run FastLED animation from loop() --- src/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 449223f..08bc0a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -124,6 +124,21 @@ void handle_serial_command(const String& cmd) { Serial.println(" pixel0/pixel1 - single pixel test"); Serial.println(" gpiotest - raw GPIO pin diagnostic"); Serial.println(" rawled - bit-bang WS2812 (no library)"); + Serial.println(" anim - re-run startup animation from loop"); + } else if (cmd == "anim") { + Serial.println("[CMD] Running animation..."); + uint32_t colors[] = {0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF, 0xFFFFFF}; + for (int c = 0; c < 7; c++) { + uint8_t r = (colors[c] >> 16) & 0xFF; + uint8_t g = (colors[c] >> 8) & 0xFF; + uint8_t b = colors[c] & 0xFF; + Serial.printf(" Colour %d: #%06X\n", c, colors[c]); + for (int i = 0; i < 8; i++) mux.set_led_color(i, r, g, b); + mux.show(); + delay(500); + } + mux.clear_all(); + Serial.println("[CMD] Animation done"); } else if (cmd == "rawled") { uint8_t pin = 9; Serial.println("[CMD] Bit-bang WS2812: pixel 0 = RED on GPIO 9");