From 2947d16ebe58b898a7eb52318f1e3b65b7906de1 Mon Sep 17 00:00:00 2001 From: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com> Date: Mon, 19 Oct 2026 21:04:54 +0330 Subject: [PATCH] test: add standalone FastLED rainbow strip sketch --- .../FastLedRainbow/FastLedRainbow.ino | 33 +++++++++++++++++++ Tools/Developer/FastLedRainbow/README.md | 21 ++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Tools/Developer/FastLedRainbow/FastLedRainbow.ino create mode 100644 Tools/Developer/FastLedRainbow/README.md diff --git a/Tools/Developer/FastLedRainbow/FastLedRainbow.ino b/Tools/Developer/FastLedRainbow/FastLedRainbow.ino new file mode 100644 index 00000000..5f5b5d1a --- /dev/null +++ b/Tools/Developer/FastLedRainbow/FastLedRainbow.ino @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2026 PCController contributors +// SPDX-License-Identifier: MIT +#include + +constexpr uint8_t DataPin = PIN_PD6; // Arduino D6, PCController strip data +constexpr uint8_t PixelCount = 100; +CRGB pixels[PixelCount]; +uint8_t hue = 0; +uint32_t frames = 0; +uint32_t lastReport = 0; + +void setup() { + // Disable the PCController's unrelated active-low shift-register outputs. + digitalWrite(PIN_PB0, HIGH); + pinMode(PIN_PB0, OUTPUT); + Serial.begin(115200); + FastLED.addLeds(pixels, PixelCount); + FastLED.setBrightness(64); + FastLED.clear(true); + Serial.println(F("FastLED rainbow: D6/PD6, WS2811, BRG, 100 pixels, brightness 64")); +} + +void loop() { + fill_rainbow(pixels, PixelCount, hue++, 7); + FastLED.show(); + ++frames; + if (millis() - lastReport >= 2000) { + lastReport = millis(); + Serial.print(F("rainbow frames=")); + Serial.println(frames); + } + delay(20); +} diff --git a/Tools/Developer/FastLedRainbow/README.md b/Tools/Developer/FastLedRainbow/README.md new file mode 100644 index 00000000..28664d99 --- /dev/null +++ b/Tools/Developer/FastLedRainbow/README.md @@ -0,0 +1,21 @@ +# FastLED rainbow hardware test + +Standalone LED test for the MiniCore ATmega328P PCController board: +D6/PD6, 100 WS2811 pixels, BRG color order, brightness 64/255, animated rainbow. +The active-low 74HC595 output enable on D8/PB0 is held disabled. Other controller +features are absent while this sketch is installed. This does not modify EEPROM. +Serial at 115200 baud reports startup configuration and frame count every two seconds. +Frame reports establish firmware execution, not physical LED output. + +Requires MiniCore and FastLED (verified with MiniCore 3.1.3, FastLED 3.10.5). +Compile and upload using Arduino CLI, replacing COM3 with the actual board port: + +```powershell +arduino-cli compile --fqbn MiniCore:avr:328:clock=16MHz_external,variant=modelP,bootloader=uart0 --build-path work/rainbow-build Tools/Developer/FastLedRainbow +arduino-cli upload --fqbn MiniCore:avr:328:clock=16MHz_external,variant=modelP,bootloader=uart0 --port COM3 --input-dir work/rainbow-build Tools/Developer/FastLedRainbow +``` + +This replaces the controller application. Preserve a board-local flash/EEPROM +backup before uploading if the installed firmware must be recoverable. Keep +those device backups private. Restore normal PCController firmware when done. +A WS2812B strip instead needs WS2812B and GRB in the addLeds template.