Go Down

Topic: Array or table interpolation (Read 547 times) previous topic - next topic


Hi I have been searching around and keep getting sidetracked for hours lol.
I am trying to use an array or similar that I can interpolate.
Lets say I have an analog input with the values of 1-1023
And I know some of the values I want for output


0 = 0
400 = 100
600 = 100
1023 = 30

Obviously 200 is 20, 500 is 100 etc.
I have looked at multimap and a few others but I am a bit lost when the numbers go up and down.

I may wish to add another row or column to make it 2D at a later date.


I take that back. multiMap is perfect and does exactly what I wanted.
I could not work out how to implement it until I found some code that worked and I changed some things around.
Still have to remove all the non relevant stuff but it works.

Go Up