Fix NUM_LEDS=10, NUM_BUTTONS=16 for 2 daisy-chained MUX boards. Fix pixel7 stuck blue (was only sending 8 LED data to 10-LED chain)

This commit is contained in:
2026-06-23 22:43:53 +00:00
parent be36ba9bf4
commit 9a56591453
5 changed files with 26 additions and 28 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class PixelStompMux;
class DefaultLedStub : public LedStub {
private:
static const uint8_t NUM_LEDS = 8;
static const uint8_t NUM_LEDS = 10;
LedState led_states[NUM_LEDS];
bool initialized;
+4 -4
View File
@@ -5,14 +5,14 @@
class PixelStompMux {
public:
static const uint8_t NUM_BUTTONS = 8;
static const uint8_t NUM_LEDS = 8;
static const uint8_t NUM_BUTTONS = 16;
static const uint8_t NUM_LEDS = 10;
PixelStompMux(uint8_t dat_pin, uint8_t ld_pin, uint8_t clk_pin, uint8_t di_pin);
void begin();
uint8_t read_buttons();
uint16_t read_buttons();
bool is_button_pressed(uint8_t index);
void set_led_color(uint8_t index, uint8_t r, uint8_t g, uint8_t b);
@@ -29,5 +29,5 @@ public:
uint8_t pin_di;
CRGB leds[NUM_LEDS];
uint8_t last_button_state;
uint16_t last_button_state;
};
+1 -1
View File
@@ -25,7 +25,7 @@ class PixelStompMux;
class DefaultSwitchStub : public SwitchStub {
private:
static const uint8_t NUM_SWITCHES = 8;
static const uint8_t NUM_SWITCHES = 16;
SwitchState switch_states[NUM_SWITCHES];
bool initialized;