Hi Robert
try this code. change c.4 to suit the input pin you are uning. the result shold be in w1
For more help, a schematic and code would help to solve you problem.
Code:
Symbol trig = C.4 'SRF005 range sensor ADC input
Symbol range = w1
main:
pulsout trig,2 ' produces about 20uS pulse (must be minimum of 10uS)
pulsin trig,1,range ' measures the range in 10uS steps
pause 10 ' SRF005 mandatory 10mS recharge period after ranging completes
let range = range * 10 /29 ' multiply by 10 then divide by 58 for 4meg or 28 for 8meg
debug
pause 100
goto main
Bill
Bookmarks