Add hardware probe and single-pixel test commands

- probe: toggles LD/CLK, reads DI state at each step, tests single pixel
- pixel0/pixel1: single pixel at max brightness for testing
- Increased LD pulse timing to 20us
- Increased CLK timing to 2us
- NeoPixel brightness raised to 80
This commit is contained in:
2026-06-23 13:45:37 +00:00
parent 07e5cd8994
commit 70097057fb
3 changed files with 72 additions and 10 deletions
+24 -2
View File
@@ -30,12 +30,14 @@ void midi_task(void* parameter) {
void handle_serial_command(const String& cmd) {
if (cmd == "dump" || cmd == "d") {
mux.dump();
} else if (cmd == "probe" || cmd == "p") {
mux.probe();
} else if (cmd == "ledon") {
for (int i = 0; i < 8; i++) {
mux.set_led_color(i, 255, 255, 255);
}
mux.show();
Serial.println("[CMD] All LEDs ON");
Serial.println("[CMD] All LEDs WHITE");
} else if (cmd == "ledoff") {
mux.clear_all();
} else if (cmd == "ledtest") {
@@ -68,8 +70,28 @@ void handle_serial_command(const String& cmd) {
} else if (cmd == "blue") {
for (int i = 0; i < 8; i++) mux.set_led_color(i, 0, 0, 255);
mux.show();
} else if (cmd == "pixel0") {
mux.set_led_brightness(255);
mux.set_led_color(0, 255, 255, 255);
mux.show();
Serial.println("[CMD] Pixel 0 WHITE (max brightness)");
} else if (cmd == "pixel1") {
mux.set_led_brightness(255);
mux.set_led_color(1, 255, 255, 255);
mux.show();
Serial.println("[CMD] Pixel 1 WHITE (max brightness)");
} else if (cmd == "help") {
Serial.println("[CMD] Commands:");
Serial.println(" dump - show button states");
Serial.println(" probe - hardware diagnostic");
Serial.println(" ledon - all LEDs white");
Serial.println(" ledoff - all LEDs off");
Serial.println(" ledtest - colour cycle");
Serial.println(" read - raw button read");
Serial.println(" red/green/blue - solid colour");
Serial.println(" pixel0/pixel1 - single pixel test");
} else {
Serial.println("[CMD] Commands: dump, ledon, ledoff, ledtest, read, red, green, blue");
Serial.println("[CMD] Unknown command. Type 'help'");
}
}