Effect of potentiometer value to ADC

geoff07

Senior Member
By output = input * input I mean that the conversion is to take the input number from the readadc command, multiply it by itself, and use that result for the next step. As a byte * byte calculation results in a longer number, the answer fits a word variable. But if you want a byte then simply divide by 255.

The conversion y=x^2 (y equals x squared) is called a quadratic, presumably because it is the calculation of the area of a quadrilateral (square of side x in this case).

Much depends on the kind of scaling that you want. It would help to understand how the number received by the adc is going to be used, then we can advise what sort of linear or non-linear conversion would do the trick.

An exponential curve is one in which the curve slope is proportional to the x value (the bigger x, the steeper the slope): y = e^x. It is similar to the quadratic in the sense that it is flatish at the start and then climbs rapidly, so has a similar effect of stretching the scale. Mathematically it is very different of course.

I suggest some www research on these maths functions - wikipedia is a good place to start.
 
Top