I’m vaguely familiar with creating exponential mapping, through the 5th argument to [scale] and the third argument to [linedrive] for example. Is it possible to ‘generically’ change an exponential INPUT to linear OUTPUT? I realise this will be vague, without knowing what the original exponent(?) is, but I simply don’t. I’m remapping the response from a Sharp GP2D12 infra-red range sensor, and the data sheet indicates a non-linear response, but no formula as such; the response graph is here:

http://www.parallax.com/dl/docs/prod/acc/SharpGP2D12Snrs.pdf

Can I “flatten the curve” in anyway, perhaps with [expr]?

Thanks

Brendan

ps logarithms frighten me :)

thanks for the response; yes the actual response curve is fixed and I am looking for a logarithmic solution to flatten that response, such that the maximum distance results in 0, half the distance = 127/2, 1/4 distance = 127/4 etc.I have tied the Arduino serial data to a slider in Max, it is slow and smooth (< c. 50) in the first 3/4 of distance/range then rises sharply to 127 over the last quarter of remaining distance/range. I'm just looking for a more linear response..

thanks

Brendan ]]>

Values between 0.5 and 1 may be suitable for compensating the non-linear response (to some degree). ]]>

thanks again; I tried your suggestion but the Exponent attribute has no effect on the response.

– Pasted Max Patch, click to expand. –

I know that setting the exponent in [scale] to < 1. has no effect so I thought your suggestion would work - is there an [expr] solution?

i.e. I gazed out the window during Maths class

]]>So a true math expert is needed…

]]>