symbol trigright = PORTB.0 ' Define output pin for Trigger pulse
symbol trigfront = PORTB.1 ' Define output pin for Trigger pulse
symbol echoright = PORTB.2 ' Define input pin for Echo pulse
symbol echofront = PORTB.3 ' Define input pin for Echo pulse
puls:
GOSUB blinkloop0
DEFINE PULSIN_MAX 65535
pulsout trigright,2 ' produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echoright,1,rangeright ' measures the range in 10uS steps
pulsf:
pulsout trigfront,2 ' produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echofront,1,rangefront ' measures the range in 10uS steps
pause 10 ' recharge period after ranging completes
'*****test for zeros******
IF rangeright = 0 then
gosub blinkloop45
endif
if rangefront = 0 then
gosub blinkloop67
endif
return
Bookmarks