28125 Parallax Inc, 28125 Datasheet - Page 286

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
The first time through the
places the value 37500 in the
37500 after the
LED connected to P8. As in the previous chapter, the value of
irDetect
freqSelect
irFrequency
time through, it’s repeated again with 39500, and so on. The result is remarkable,
especially considering you are using parts that were designed for a completely different
purpose, to make IR communication between a handheld remote and a television
possible.
Example Program – TestLeftFrequencySweep.bs2
TestLeftFrequencySweep.bs2 does two things. First, it tests the left IR LED/detector pair
(connected to P8 and P9) to make sure they are functioning properly for distance
detection. However, it also demonstrates how the frequency sweep illustrated in Figure
8-2 is accomplished.
When you run the program, the Debug Terminal will display your zone measurement.
There are many possible yes-no patterns that can be generated; two are shown in Figure
8-3. The test patterns will vary depending on the characteristics of the filter inside the IR
detector.
The program determines which zone the detected object is in by counting the number of
“No” occurrences. Notice that even though the two Debug Terminal test patterns in
Figure 8-3 are different,
Therefore, “Zone 2” is the location of the object detected in both examples.
NEXT
FREQOUT 8,1, irFrequency
irDetect = IN9
variable.
' Commands not shown...
is now 1, which means the
variable, and the process is repeated for this higher frequency. The third
LOOKUP
The second time through the
command, the
FOR
they both have three “Yes” and two “No” occurrences.
irFrequency
NEXT
FREQOUT
loop,
freqSelect
LOOKUP
variable. Since
command sends that frequency to the IR
command places 38250 into the
FOR
is 0, so the
NEXT
IN9
irFrequency
loop, the value of
is then saved in the
LOOKUP
command
contains

Related parts for 28125