Tuesday, October 14, 2008

1 led and PING sensor

JON W. TURKULA, JOHN BECKER, WAYNE CONGER JR

This was an excersize in getting the PING sensor to activate a LED when the distance recorded is less than 15 cm.

' 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 20

IF time <>

IF time = 0015 THEN LOW 0

IF time > 0015 THEN LOW 0
LOOP


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?