FSLP calculation

I am programming my Arduino for using the FSLP as a Midi controller. Can I simply “map” the raw readings for both pressure and position like this?
int midiPressure = map(pressure, 0, 1023, 0, 127);
int midiPosition = map(position, 0, 1023, 0, 127);
I am bit confused by the formulas in the demo code for adjustedPosition and adjustedPressure for controlling the led strip:
int adjustedPosition = (int32_t)position * LED_COUNT / 1000;
int adjustedPressure = pressure * 8 / 10;



Yes, you can scale the raw readings like you described.

In that demo code adjustedPosition was scaled to control how many LEDs would light up and adjustedPressure controlled the color. Scaling the pressure by 8/10 was mostly determined empirically to get the desired sensitivity. So, for the pressure, you might want to adjust the scaling values to make it more or less sensitive depending on your application.


I’d only add that when I did a project like this with force sensing linear potentiometers (FSLP) the ends of the range were inconsistent from unit to unit, and so it was useful to reduce the domain so that the user could always access the full range. A lot of synthesizer faders seem to behave this way, with small zones at each end representing full on and full off.

1 Like

Thank you, I will try it.

One more question - I need the final product with FSLP as small as possible. Can I bend the flexible strip in 90 or even 180 degrees or I will damage the traces?

The FSLP products are generally intended for flat surfaces. They are flexible, and you could probably use them on a gently rounded surface, but bending them too much can negatively impact performance (or cause damage).