Do you know how to use graph paper? Think of a graph.
The horizontal scale is the x-axis. The vertical scale is the y-axis.
Do you know the equation for a straight line?
You have two points on the graph, (x1,y1) and (x2,y2).
The points are (680,1137) and (830,1377). Take it from there.
If you need more help, let me know.
Thanks
Since the ranges are constant, it looks like some of that can
be calculated just once and simplified.
ie (Newmax - Newmin) which will make things easier.
Yes it is for a microcontroller, and I'm stuck with integers.
volts = avoltage * 10 '
volts = volts - 2550 '
volts = volts * 10 '
volts = volts / 575 '
volts = volts * 93 '
volts = volts + 4450 '
This is the best I've come up with so far.
There is some error, but the end display is never more
than 0.1 Volt in error when within range according to my multimeter.
avoltage is the original value, volts is the working variable being converted.
1137 and 1377 (the range to convert to) is a reading
from 11.37 volts to 13.77 volts, but since then, new samples have been taken in order to extend that range.