Download Print this page

Parallax 555-27401 Manual page 4

Qti sensor kickstart

Advertisement

' {$STAMP BS2}
' {$PBASIC 2.5}
SnsrIn CON 9
Duration VAR Word
Read_Sensor:
HIGH SnsrIn
PAUSE 1
RCTIME SnsrIn, 1, Duration
Display:
DEBUG HOME
DEBUG "-----", CR
DEBUG DEC Duration, CLREOL
PAUSE 250
GOTO Read_Sensor
Note: When this program is run, the BASIC Stamp Debug Terminal will automatically open.
Note: Depending on surface reflectivity, values will range from about 60 to 3400.
Propeller BOE and Propeller QuickStart
Propeller BOE Wiring Diagram
OBJ
debug
: "FullDuplexSerial"
rc
: "RCTime"
CON
Copyright © Parallax Inc.
' Line sensor input (R)
' Holds duration value
' Discharge QTI cap
' Wait 1 ms
' Read sensor value
' Display value
' Wait 250 ms, repeat
Propeller QuickStart Wiring Diagram
Page 4 of 6

Advertisement

loading