Switch from NeoPixel to FastLED for ESP32-S3 LED reliability
FastLED has better ESP32 support and handles timing/RMT properly. - Use CRGB array instead of Adafruit_NeoPixel - FastLED.show() is more reliable on ESP32-S3 - probe command now tests all LEDs at max brightness
This commit is contained in:
+12
-12
@@ -19,7 +19,7 @@ void DefaultLedStub::set_mux(PixelStompMux* mux) {
|
||||
}
|
||||
|
||||
void DefaultLedStub::begin() {
|
||||
Serial.println("[LED] Using WS2812C via PixelStomp MUX");
|
||||
Serial.println("[LED] Using WS2812C via PixelStomp MUX (FastLED)");
|
||||
initialized = true;
|
||||
|
||||
if (!mux_ptr) {
|
||||
@@ -30,13 +30,13 @@ void DefaultLedStub::begin() {
|
||||
Serial.println("[LED] Startup animation...");
|
||||
|
||||
uint32_t colors[] = {
|
||||
0xFF0000, // Red
|
||||
0x00FF00, // Green
|
||||
0x0000FF, // Blue
|
||||
0xFFFF00, // Yellow
|
||||
0xFF00FF, // Magenta
|
||||
0x00FFFF, // Cyan
|
||||
0xFFFFFF, // White
|
||||
0xFF0000,
|
||||
0x00FF00,
|
||||
0x0000FF,
|
||||
0xFFFF00,
|
||||
0xFF00FF,
|
||||
0x00FFFF,
|
||||
0xFFFFFF,
|
||||
};
|
||||
int num_colors = sizeof(colors) / sizeof(colors[0]);
|
||||
|
||||
@@ -51,7 +51,7 @@ void DefaultLedStub::begin() {
|
||||
}
|
||||
mux_ptr->show();
|
||||
Serial.printf("[LED] Colour %d: R=%d G=%d B=%d\n", c, r, g, b);
|
||||
delay(200);
|
||||
delay(300);
|
||||
}
|
||||
|
||||
clear_all();
|
||||
@@ -71,15 +71,15 @@ void DefaultLedStub::set_led_state(uint8_t note, uint8_t channel, uint8_t veloci
|
||||
led_states[led_index].timestamp = millis();
|
||||
|
||||
if (velocity > 0) {
|
||||
uint8_t brightness = map(velocity, 1, 127, 30, 255);
|
||||
uint8_t brightness = map(velocity, 1, 127, 50, 255);
|
||||
mux_ptr->set_led_color(led_index, brightness, brightness, brightness);
|
||||
} else {
|
||||
mux_ptr->set_led_color(led_index, 0, 0, 0);
|
||||
}
|
||||
mux_ptr->show();
|
||||
|
||||
Serial.printf("[LED] Note %d -> LED %d Ch %d Vel %d (%s)\n",
|
||||
note, led_index, channel, velocity,
|
||||
Serial.printf("[LED] Note %d -> LED %d Vel %d (%s)\n",
|
||||
note, led_index, velocity,
|
||||
velocity > 0 ? "ON" : "OFF");
|
||||
} else {
|
||||
Serial.printf("[LED] Out of range: %d (Note: %d)\n", led_index, note);
|
||||
|
||||
Reference in New Issue
Block a user