28125 Parallax Inc, 28125 Datasheet - Page 227

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
LOOP
Your Turn
Following the Flashlight Beam
You have been using variable declarations up to this point. For example,
Nib
RAM. After you have declared the variable, every time you use
program, it uses the value stored at that particular location in the BASIC Stamp’s RAM.
You can also declare constants. In other words, if you have a number you plan on using
in your program, give it a useful name. Instead of the
directive. Here are some
LeftAmbient
RightAmbient
LeftBright
RightBright
Now, everywhere in the program the name
use the number 108. Everywhere
value 114. Likewise, everywhere
RightBright
program.
PAUSE 3
RCTIME 6,1,timeLeft
HIGH 3
PAUSE 3
RCTIME 3,1,timeRight
DEBUG CRSRXY, 0, 3,
PAUSE 100
gives the name
Try facing the Boe-Bot in different directions, and repeat your measurements.
For better results, you can average your measurements for "flashlight on" and
"flashlight off" and replace the values in Table 6-1 with your average values.
DEC5 timeLeft,
"
DEC5 timeRight
is 22. You will substitute your values from Table 6-1 before running the
",
CON
CON
CON
CON
counter
CON
108
114
20
22
directives from the next example program:
to a particular memory location in the BASIC Stamp’s
RightAmbient
LeftBright
LeftAmbient
is used, the BASIC Stamp will use the
appears, it’s really the value 20, and
' Right RC time measurement.
' Display measurements.
is used, the BASIC Stamp will
VAR
directive, use the
counter
counter VAR
in a PBASIC
CON

Related parts for 28125