28125 Parallax Inc, 28125 Datasheet - Page 229

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
' -----[ Title ]--------------------------------------------------------------
' Robotics with the Boe-Bot - FlashlightControlledBoeBot.bs2
' Boe-Bot follows flashlight beam focused in front of it.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
' -----[ Constants ]----------------------------------------------------------
' REPLACE THESE VALUES WITH THE VALUES YOU DETERMINED AND ENTERED INTO
' TABLE 6.1.
LeftAmbient
RightAmbient
LeftBright
RightBright
'
LeftThreshold
RightThreshold CON
' -----[ Variables ]----------------------------------------------------------
' Declare variables for storing measured RC times of the
' left & right photoresistors.
timeLeft
timeRight
' -----[ Initialization ]-----------------------------------------------------
Substitute your
value 114 in the
Substitute your
the value 20 in the
Substitute your
of the value 22 in the
Reconnect power to your board and servos.
Save and then run FlashlightControlledBoeBot.bs2.
Experiment and figure out exactly where to focus the light to get the forward,
left turn, and right turn maneuvers to execute.
Use the flashlight to guide your Boe-Bot through various obstacle courses and
maneuvers.
CON
CON
CON
CON
CON
VAR
VAR
timeLeft
timeRight
timeRight
RightAmbient CON
108
114
20
22
LeftBright + LeftAmbient / 2
RightBright + RightAmbient / 2 * 5 / 8
Word
Word
Average
LeftBright CON
RightBright CON
measurement with focused flashlight beam in place of
measurement with no flashlight beam in place of the
measurement with focused flashlight beam in place
directive.
directive.
directive.
' Stamp directive.
' PBASIC directive.
Scale factor
* 5 / 8

Related parts for 28125