Hi Paco,
Ok. Glad there is no delay. It is all about the feel. Regardless of the data put into the table, there should be no delay;
Perhaps the loop code was modified as well.
Regarding this person's exponential curve code, its beginning needs to exactly match the linear portion's end. No big jump at the switchpoint!
Also, it needs parens around the "int".
I'd change it to (adding your deadband)
int deadbandXvalue = 25; // or whatever
//...
if (i < deadbandXvalue)
lookupTable[i] = 0;
else
if (i < switchpointXValue)
lookupTable[i] = map(i, deadbandXvalue, switchpointXValue, speedstartValue, switchpointYValue);
else
lookupTable[i] = switchpointYValue + (int) (sqrt (map(i, switchpointXValue, 255, 0, 255 - switchpointYValue)) * 15.96934);
Also, I'd make the curve adjustable, by changing the last line to:
lookupTable[i] = (int) (0.5 + (switchpointYValue + pow( map(i, switchpointXValue, 255, 0, 255 - switchpointYValue ) / 255.0, curvePower) * 255.0));
CurvePower of 2.0 is the same as sqrt. Raising curvePower up to 3,4, 5 or more increased the extremeness of the curve.
Bring curvePower down from 2.0 to 1.0 reduces the curviness.
As a test, CurvePower of 1.0 should be the same as a linear continuation past the switchPoint to (255, 255).
Also, you might like the following old trick to produce a quick and dirty graph view.
For each line "lookupTable[0] = 0;" also print before the CR a series of asterisks, their number (for 51 asterisks being 100%, or 255) being
numAsterisks = lookupTable [ i ] / 5;
The linear and curved portions should be readily apparent (when you tilt your head 90 deg clockwise. )
Cheers!