Page 242 ·
Robotics with the Boe-Bot
√
Change the
DEBUG
statement, title and comments to refer to the right IR pair.
√
Change the variable name from
irDetectLeft
to
irDetectRight
. You will
need to do this in four places in the program.
√
Change the
FREQOUT
command’s
Pin
argument from 8 to 2.
√
Change the input register monitored by the
irDetectRight
variable from
IN9
to
IN0
.
√
Repeat the testing steps in this activity for the right IR pair; with the IR LED
circuit connected to P2 and the detector connected to P0.
ACTIVITY #2: FIELD TESTING FOR OBJECT DETECTION AND
INFRARED INTERFERENCE
In this activity, you will build and test indicator LEDs that will tell you if an object is
detected without the help of the Debug Terminal. This is handy if you are not near a PC
or laptop, and you need to trouble-shoot your IR detector circuits. You will also write a
program to “sniff” for infrared interference from fluorescent lights. Some fluorescent
lights send signals that resemble the signal sent by your infrared LEDs. The device
inside a fluorescent light fixture that controls voltage for the lamp is called the ballast.
Some ballasts operate in the same frequency range of your IR detector, 38.5 kHz, which
in turn causes the lamp to emit a signal at this frequency. When you integrate IR object
detection with navigation, this interference can cause some bizarre Boe-Bot behavior!
Rebuilding the LED Indicator Circuits
These are the same LED indicator circuits that you used with the whiskers.
Parts List:
(2) Red LEDs
(2) Resistors – 220
Ω
(red-red-brown)
√
Disconnect power from your board and servos.
√
Build the circuit shown in Figure 7-6 using Figure 7-7 as a reference.