Pir sensor
speakers2010
Posts: 6
I took the sample PIR sensor code from parallax and im trying to make my boe bot drive everytime it sees something move and I cant seem to get the program right.· The program I wrote just doesnt seem to work.
' =========================================================================
' File...... PIR_Simple.bs2
' Purpose... Show Output State Of PIR Sensor
' Author.... Parallax, Inc.
' E-mail.... support@parallax.com
' Started... 12-14-2005
' {$STAMP BS2}
' {$PBASIC 2.5}
'
'
[noparse][[/noparse] Program Description ]
' This program displays the current state of the PIR Sensor connected to P14
' on the DEBUG screen.
'
[noparse][[/noparse] Program Code ]
Main:
DO
DEBUG HOME, BIN1 IN14 ' Display Status Of P14 At Home Pos.
PAUSE 10 ' Small Delay
IF IN14 = 1· THEN
· PULSOUT 12, 650
· PULSOUT 13, 850
ENDIF
LOOP
' =========================================================================
' File...... PIR_Simple.bs2
' Purpose... Show Output State Of PIR Sensor
' Author.... Parallax, Inc.
' E-mail.... support@parallax.com
' Started... 12-14-2005
' {$STAMP BS2}
' {$PBASIC 2.5}
'
'
[noparse][[/noparse] Program Description ]
' This program displays the current state of the PIR Sensor connected to P14
' on the DEBUG screen.
'
[noparse][[/noparse] Program Code ]
Main:
DO
DEBUG HOME, BIN1 IN14 ' Display Status Of P14 At Home Pos.
PAUSE 10 ' Small Delay
IF IN14 = 1· THEN
· PULSOUT 12, 650
· PULSOUT 13, 850
ENDIF
LOOP
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen