Hi friends, i have bought a SRF05 sensor and today has arrived to me
. I'm trying to test it with an 16x4 LCD but it does not works like i want, maybe im wrong in my code, i know that is very simple but i don't know why it does not works.
the info about this senor is here:
http://www.msebilbao.com/notas/downloads/Medidor%20Ultrasonico%20SRF05.pdfand this is my code:
Echo VAR Portb.2
Trigger var Portb.4
Ancho var word
Dist_cm var word
trigger = 0
main:
trigger = 0
pulsout trigger,1
pulsin echo,1,ancho
dist_cm = (ancho/29)
LCDOUT $FE, 1
LCDOUT "CM =", DEC DIST_CM
goto main
end