28125 Parallax Inc, 28125 Datasheet - Page 224

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
' Robotics with the Boe-Bot - TestP6Photoresistor.bs2
' Test Boe-Bot photoresistor circuit connected to P6 and display
' the decay time.
' {$STAMP BS2}
' {$PBASIC 2.5}
timeLeft
DO
LOOP
Your Turn
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.
HIGH 6
PAUSE 2
RCTIME 6,1,timeLeft
DEBUG HOME, "timeLeft = ", DEC5 timeLeft
PAUSE 100
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.
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
and
RCTIME
VAR
commands, changing them from 6 to 3.
Word
' Stamp directive.
' PBASIC directive.
Pin
arguments for both the
HIGH

Related parts for 28125