From 6019b7bda4a49698f873492ac119b7185dddb88a Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 28 Aug 2022 13:33:48 +0200 Subject: [PATCH] GEQ: use full frequency range also when user wants less than 16 bands. Previously when users selected fewer bands (like 4 instead of 16), only the lowest freq channels were displayed. --- wled00/FX.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index a57aaafb8..3a1f7dd37 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -7109,6 +7109,7 @@ uint16_t mode_2DGEQ(void) { // By Will Tatam. Code reduction by Ewoud Wijma. for (int x=0; x < cols; x++) { uint8_t band = map(x, 0, cols-1, 0, NUM_BANDS - 1); + if (NUM_BANDS < 16) band = map(band, 0, NUM_BANDS - 1, 0, 15); // always use full range. comment out this line to get the previous behaviour. band = constrain(band, 0, 15); uint16_t colorIndex = band * 17; uint16_t barHeight = map(fftResult[band], 0, 255, 0, rows); // do not subtract -1 from rows here