28125 Parallax Inc, 28125 Datasheet - Page 289

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
so that they read
Displaying Both Distances
It’s useful at times to have a quick program you can run to test both the Boe-Bot’s
distance detectors at the same time. This program is organized into subroutines, which
can be handy for copying and pasting into other programs that require distance detection.
Example Program – DisplayBothDistances.bs2
' -----[ Title ]--------------------------------------------------------------
' Robotics with the Boe-Bot - DisplayBothDistances.bs2
' Test IR detector distance responses of both IR LED/detector pairs to
' frequency sweep.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Variables ]----------------------------------------------------------
freqSelect
irFrequency
irDetectLeft
irDetectRight
distanceLeft
distanceRight
' -----[ Initialization ]-----------------------------------------------------
DEBUG CLS,
' -----[ Main Routine ]-------------------------------------------------------
"IR OBJECT ZONE", CR,
"Left
"-----
Modify TestLeftFrequencySweep.bs2 for testing the distance measurement of
the right IR LED/detector pair.
Run the program and verify that this pair can measure a similar distance.
Enter, save, and run DisplayBothDistances.bs2.
Repeat the distance measurement exercise with a sheet of paper on each LED,
then on both LEDs at the same time.
FREQOUT 2,1, irFrequency
irDetect = IN0
Right", CR,
-----"
VAR
VAR
VAR
VAR
VAR
VAR
Nib
Word
Bit
Bit
Nib
Nib
' Stamp directive.
' PBASIC directive.

Related parts for 28125