MIDI instrument - controlling Neopixels (ws2812) with softpots - only 2 out of 3 softpots are controlling pixels as expected

If a program does not work as expected reduce the possible bugs by reducing variety.

In the testcode

Your variable

int calibrationMax[] = {
  0, 0, 0
};

is initialised with zero and gets never assigned any other value
variable

    calibrationMin[i] = EEPROM.read(21 + (21 * i));

gets assigned values
This means you call the function map with
... map(value,10,0...)
Where the second parameter should be a min-value compared to max-value (the third parameter)

So if you change the map-function to use hardcoded numbers
and test again. WHat values do you get?
Ad if these values are correct, change one single hardcoded value back to the variable and check again etc.

best regards Stefan

1 Like