Add visual MIDI activity indicator

Flash LED 0 white for 30ms on any MIDI input.
Visible without serial - helps diagnose whether MIDI
is arriving when connected to iPad with Loopy Pro.
This commit is contained in:
ash
2026-06-25 06:43:00 +00:00
parent 40dfe775ea
commit 500720dadf
4 changed files with 47 additions and 0 deletions
+36
View File
@@ -258,3 +258,39 @@ void DefaultLedStub::set_led_brightness(uint8_t brightness) {
mux_ptr->set_led_brightness(brightness);
mux_ptr->show();
}
void DefaultLedStub::flash_activity() {
if (!initialized || !mux_ptr) return;
uint32_t now = millis();
// Save current LED 0 color if we just started flashing
if (now >= activity_off_time) {
saved_r = 0;
saved_g = 0;
saved_b = 0;
if (led_states[0].active) {
uint32_t color = launchpad_palette[led_states[0].velocity];
saved_r = (color >> 16) & 0xFF;
saved_g = (color >> 8) & 0xFF;
saved_b = color & 0xFF;
}
}
// Flash LED 0 white
mux_ptr->set_led_color(0, 255, 255, 255);
mux_ptr->show();
activity_off_time = now + 30;
}
void DefaultLedStub::update() {
if (!initialized || !mux_ptr) return;
// Turn off activity flash after 30ms
uint32_t now = millis();
if (activity_off_time > 0 && now >= activity_off_time) {
mux_ptr->set_led_color(0, saved_r, saved_g, saved_b);
mux_ptr->show();
activity_off_time = 0;
}
}