This isn’t purely FastLED related but I thought I would share since it may affect users who use the arduino map() function (particularly with potentiometers). I was banging my head a few weeks back because I noticed that whenever I selected the final mapped value on my potentiometer, I would get a weird “bounce” issue which manifests itself as flickering between that value and the previous value. I initially thought it was due to the potentiometer itself but swapping in new ones didn’t fix the problem.
“To give a real world scenario as to why this needs changed consider this. You are using the arduino with a sensor to sample data and based on this data set a servo into 1 of 4 positions. The arduino uses a 10 bit adc and outputs integers from 0 to 1023. You would use map(x, 0, 1023, 1, 4). With the map function as it is currently the only time position 4 would be active is when the arduino outputs the integer 1023. With my proposed change each position would get an equal share of the possible range. When they converted this function from a float function to an integer function they didn’t consider that the output is no longer a value but a position. Value mapping maps one value to another and the function works perfectly for floats. Positional mapping distributes the input as evenly as possible to the output and the function as is doesn’t do that.”
My project specifically uses positional mapping which is when the problem comes up.