Hi there guys. I am currently working on a distance measurement application using the sharp rangefinder. I am using a PIC 16F690 microcontroller to read in the analogue voltage signal from the rangefinder. The maximum distance measured by this sensor is 30cm. The problem I am have is writing the math routine to convert the adc value too distance. For this project, I must use PIC assembly language. The equation for the conversion is :
volts = analogRead(IRpin)*0.0048828125
distance = 12.21*exp(volts -1.15)
I am a newbie at PIC assembly, so any help would help me greatly assist me. The ADC is 10 bit. The exp is short for exponent.
volts = analogRead(IRpin)*0.0048828125
distance = 12.21*exp(volts -1.15)
I am a newbie at PIC assembly, so any help would help me greatly assist me. The ADC is 10 bit. The exp is short for exponent.