Fix USB MIDI, add LED startup animation, improve logging

- Use ArduinoUSBMIDI library for proper USB MIDI device recognition
- Add LED startup colour cycle (red, green, blue, yellow, magenta, cyan, white)
- Add comprehensive console logging for all MIDI in/out and switch events
- Log unmapped MIDI messages
This commit is contained in:
2026-06-23 13:06:57 +00:00
parent c1b163c8b8
commit 4d81386f78
6 changed files with 130 additions and 98 deletions
+34 -1
View File
@@ -13,7 +13,40 @@ DefaultLedStub::DefaultLedStub() : initialized(false) {
void DefaultLedStub::begin() {
initialized = true;
Serial.println("[LED] Stub initialized (GPIO pins not configured yet)");
Serial.println("[LED] Startup colour cycle...");
uint16_t colours[] = {
0xF800, // Red
0x07E0, // Green
0x001F, // Blue
0xFFE0, // Yellow
0xF81F, // Magenta
0x07FF, // Cyan
0xFFFF, // White
};
int num_colours = sizeof(colours) / sizeof(colours[0]);
for (int c = 0; c < num_colours; c++) {
uint16_t colour = colours[c];
uint8_t r = (colour >> 11) & 0x1F;
uint8_t g = (colour >> 5) & 0x3F;
uint8_t b = colour & 0x1F;
for (int i = 0; i < NUM_LEDS; i++) {
led_states[i].note = i;
led_states[i].channel = 1;
led_states[i].velocity = 100;
led_states[i].active = true;
led_states[i].timestamp = millis();
}
Serial.printf("[LED] Colour %d: R=%d G=%d B=%d\n", c, r, g, b);
delay(100);
}
clear_all();
Serial.println("[LED] Startup cycle complete");
}
void DefaultLedStub::set_led_state(uint8_t note, uint8_t channel, uint8_t velocity) {