Hi all,

I am building a small system to read a laser distance finder. This sensor outputs a 0-10 volt signal based on the distance from the object.
I am reducing the voltage to 0-5v with a voltage divider so that i get 0-5 v to AD0 on my PIC16F876.

Here are some examples of the data I'm getting back

Distance AD count
42.9 820
36.3 675
33.3 600
19.7 270
11.2 60

What i need to do is come up with a formula to convert the A/D readings into distance. So far I am failing miserably! The sensor can be adjusted to select where 0 is in distance and where 10v is. I currently have it set so that 6" is 0v and 50" is 10V I figure that I will have to provide a calibration routine that samples a near point (known distance) and a far point (known distance).

I REALLY need help with the math here to make this silly thing work.

Thanks in Advance,

Dave