Robotics with the Boe-Bot text v2.2

Page 322 · Robotics with the Boe-Bot
Cup your hand over the photoresistors, making sure that you are casting equal
shade over both. For best results, the measurements should be in the 200 to 400
range.
Record the values of both time measurements in the second row of Table F-1.
Table F-1: RC-Time Measurements in Ambient and Low Light
Duration Values
timeLeft timeRight
Description
Photoresistors in uniform ambient light
Photoresistors in uniform low light
' Robotics with the Boe-Bot - TestPhotoresistors.bs2
' Test Boe-Bot photoresistor circuits.
' {$STAMP BS2} ' Stamp directive.
' {$PBASIC 2.5} ' PBASIC directive.
timeLeft VAR Word ' Variable declarations.
timeRight VAR Word
DEBUG "PHOTORESISTOR VALUES", CR, ' Initialization.
"timeLeft timeRight", CR,
"-------- ---------"
DO ' Main routine.
HIGH 6 ' Left RC time measurement.
PAUSE 3
RCTIME 6,1,timeLeft
HIGH 3 ' Right RC time measurement.
PAUSE 3
RCTIME 3,1,timeRight
DEBUG CRSRXY, 0, 3, ' Display measurements.
DEC5 timeLeft,
" ",
DEC5 timeRight
PAUSE 200
LOOP