this is the basic use of a ping sensor to measure distance in an output window.
' PingTest.bs2
' {$STAMP BS2}' {$PBASIC 2.5}
time VAR Word
DO
PULSOUT 15, 5
PULSIN 15, 1, time
time = time ** 2251
DEBUG CR, "Distance = ", DEC4 time, " cm"
PAUSE 100
LOOP
# posted by jon turkula : 4:25 AM