![Parallax Boe-Bot Student Manual Download Page 224](http://html2.mh-extra.com/html/parallax/boe-bot/boe-bot_student-manual_3646721224.webp)
Page 210 ·
Robotics with the Boe-Bot
√
Cast a shadow over the photoresistor connected to P6 and verify that the time
measurement gets larger as the environment gets darker.
√
Point the photoresistor’s light collecting surface directly at an overhead light, or
shine flashlight directly at it. The time measurement should get very small. It
should then get larger as you gradually direct the photoresistor further away from
the light source. It should get even larger if you cast a shadow over it or turn out
the lights.
' Robotics with the Boe-Bot - TestP6Photoresistor.bs2
' Test Boe-Bot photoresistor circuit connected to P6 and display
' the decay time.
' {$STAMP BS2} ' Stamp directive.
' {$PBASIC 2.5} ' PBASIC directive.
timeLeft VAR Word
DO
HIGH 6
PAUSE 2
RCTIME 6,1,timeLeft
DEBUG HOME, "timeLeft = ", DEC5 timeLeft
PAUSE 100
LOOP
Your Turn
√
Save TestP6Photoresistor.bs2 as TestP3Photoresistor.bs2.
√
Modify the program so that it performs the RC decay time measurement on the
right photoresistor, the one connected to P3.
√
Repeat the shadow and bright light tests with the P3 RC circuit and verify that it
works correctly. You will need to modify the
Pin
arguments for both the
HIGH
and
RCTIME
commands, changing them from 6 to 3.
ACTIVITY #5: FLASHLIGHT BEAM FOLLOWING BOE-BOT
In this activity, you will test and calibrate your Boe-Bot’s light sensors so that they
recognize the difference between ambient light and a directed flashlight beam. You will
then program the Boe-Bot to follow the flashlight beam that is pointed at the surface in
front of the Boe-Bot.