FIX SWAPPED PINS: GPIO 9 is 74HC165 data, GPIO 12 is WS2812C data. Product docs: DAT/LD/CLK = 74HC165, + WS2812C data.

This commit is contained in:
2026-06-23 22:31:08 +00:00
parent 8d585e9c40
commit cc6cc2fa32
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -10,7 +10,7 @@
#include "switch_stub.h" #include "switch_stub.h"
#include "app_task.h" #include "app_task.h"
PixelStompMux mux(9, 10, 11, 12); PixelStompMux mux(12, 10, 11, 9);
DefaultLedStub led_driver; DefaultLedStub led_driver;
DefaultSwitchStub switch_driver; DefaultSwitchStub switch_driver;
@@ -99,10 +99,10 @@ void handle_serial_command(const String& cmd) {
int fl = digitalRead(pin); int fl = digitalRead(pin);
Serial.printf(" %s: PULLUP=%d PULLDOWN=%d FLOAT=%d\n", names[p], hi, lo, fl); Serial.printf(" %s: PULLUP=%d PULLDOWN=%d FLOAT=%d\n", names[p], hi, lo, fl);
} }
Serial.println(" Testing DAT(9) output toggle..."); Serial.println(" Testing WS2812(12) output toggle...");
pinMode(9, OUTPUT); pinMode(12, OUTPUT);
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
digitalWrite(9, HIGH); digitalWrite(12, HIGH);
delayMicroseconds(100); delayMicroseconds(100);
int readback = digitalRead(9); int readback = digitalRead(9);
Serial.printf(" HIGH -> readback=%d\n", readback); Serial.printf(" HIGH -> readback=%d\n", readback);
@@ -140,7 +140,7 @@ void handle_serial_command(const String& cmd) {
mux.clear_all(); mux.clear_all();
Serial.println("[CMD] Animation done"); Serial.println("[CMD] Animation done");
} else if (cmd == "rawled") { } else if (cmd == "rawled") {
uint8_t pin = 9; uint8_t pin = 12;
Serial.println("[CMD] Bit-bang WS2812: pixel 0 = RED on GPIO 9"); Serial.println("[CMD] Bit-bang WS2812: pixel 0 = RED on GPIO 9");
uint8_t colour[] = {0x00, 0xFF, 0x00}; uint8_t colour[] = {0x00, 0xFF, 0x00};
noInterrupts(); noInterrupts();
+1 -1
View File
@@ -18,7 +18,7 @@ void PixelStompMux::begin() {
delay(100); delay(100);
FastLED.addLeds<WS2812, 9, GRB>(leds, NUM_LEDS); FastLED.addLeds<WS2812, 12, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(128); FastLED.setBrightness(128);
fill_solid(leds, NUM_LEDS, CRGB::Black); fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show(); FastLED.show();