Hi,
I am trying to get a distance reading from Sharp GP2Y0A21YK0F Infrared range finder. I used the following code to get the distance reading;
main:
readadc10 0, w2
let w2=w2+1
let w2=6500/w2
let w2=w2-4
let w3=w2
debug w3
goto main
I am getting a fluctuating reading, the distance reading seems to vary +/- 7cm from the actual value. I tried to ground the unused ADC inputs but still the problem is the same. If anyone have any experience on this please help.
Thanks in advance
Rudra
I am trying to get a distance reading from Sharp GP2Y0A21YK0F Infrared range finder. I used the following code to get the distance reading;
main:
readadc10 0, w2
let w2=w2+1
let w2=6500/w2
let w2=w2-4
let w3=w2
debug w3
goto main
I am getting a fluctuating reading, the distance reading seems to vary +/- 7cm from the actual value. I tried to ground the unused ADC inputs but still the problem is the same. If anyone have any experience on this please help.
Thanks in advance
Rudra