That's very redundant. Your problem really is to map a [0..255] value to [0..255] logarithmically. If you need speed, you calculate the logarithmic transformation offline and store that results in a lookup table.

lookupTable[] is also very easy to calculate: for sensor value 0..255, you want the lookupTable to return (255/log(255)) * log(sensor value), other than for sensor value 0, the lookupTable should return 0.

Thanks for your explanation.We already use offline lookuptable filling.The lookuptable is filled with data in a seperate function. "void fillLookupTable"See the code in the response 120 from Rob.

I will post the full code as attachment now too.Rob also said he liked to view the whole code.Problem is it is so large now to place here in code tags.Threrefor the snippets are less confusing...........? :-)

So I attach the last code I have as zip.It is dirty as you can get from a low level programmer like me.Could be faster in the end.........

You mean to BURN the table in the flashrom?What I understand this will only work if you have only one curve to use.If that is the case it will not work?During use of the controller the lookuptable will change by changing startspeed, X and Y pointvalue and if we use an real exponential curve the curveValue.