Cleanup pair octaves

This commit is contained in:
Brian Hrebec 2023-09-01 11:09:09 -05:00
parent 00cdfc08e0
commit c09177c0ee
9 changed files with 119 additions and 70 deletions

View file

@ -25,6 +25,14 @@ void singleLED(int n, int color) {
// 0 -> 0, 0, 0, 0, 0, 0, 0, 0
void ledFullMeter(byte indicatedValue, int color){
static byte lastVal = 0;
static int lastColor = 0;
if (lastVal == indicatedValue && lastColor == color) {
return;
}
lastVal = indicatedValue;
lastColor = color;
int scaledVal = indicatedValue;
ledStrip.setBrightness(1);
for (int i = 0; i < 8; i++) {
@ -79,5 +87,9 @@ void statusLedBlink() {
}
void updateSensorLEDs(instrument_state_t &state) {
ledFullMeter(state.breathCCVal, 0x0000FF);
if (millis() - state.lastKnobTime < KNOB_DISPLAY_TIME) {
ledFullMeter(state.lastKnobVal, 0x00FF00);
} else {
ledFullMeter(state.breathCCVal, 0x0000FF);
}
}