28125 Parallax Inc, 28125 Datasheet - Page 231

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
How FlashlightControlledBoeBot.bs2 Works
These are the four constant declarations that you used with your own values from Table
6-1.
Now that the four constants have been declared, the next two lines average and scale the
values to come up with threshold values for the program. These threshold values can be
compared with the current
whether the photoresistors are sensing ambient light or a focused beam.
These variables are used to store the
This is the reset indicator that has been used in most of the programs in this text.
The Main Routine section contains just two subroutine calls. All the actual work in the
program occurs in the two subroutines.
measurements for both RC photoresistor circuits, and the
decisions and delivers the servo pulses.
LeftAmbient
RightAmbient
LeftBright
RightBright
'
LeftThreshold
RightThreshold CON
timeLeft
timeRight
FREQOUT 4, 2000, 3000
DO
LOOP
GOSUB Test_Photoresistors
GOSUB Navigate
CON
CON
CON
CON
CON
VAR
VAR
timeLeft
RCTIME
108
114
20
22
LeftBright + LeftAmbient / 2
RightBright + RightAmbient / 2 * 5 / 8
Word
Word
Average
and
measurements.
Test_Photoresistors
timeRight
Navigate
measurements to determine
subroutine makes the
takes the
Scale
* 5 / 8
RCTIME

Related parts for 28125