28125 Parallax Inc, 28125 Datasheet - Page 263

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
ACTIVITY #4: OBJECT DETECTION AND AVOIDANCE
An interesting thing about the IR detectors is that their outputs are just like the whiskers.
When no object is detected, the output is high; when an object is detected, the output is
low. In this activity, RoamingWithWhiskers.bs2 from page 178 is modified so that it
works with the IR detectors.
Converting the Whiskers Program for IR Object Detection/Avoidance
This next example program started as RoamingWithWhiskers.bs2. Aside from adjusting
the name and description, two bit variables were added to store the states of the IR
detectors.
A routine was also added to read the IR pairs.
Repeat with 2 kΩ resistors.
Repeat with 470 Ω resistors.
Repeat with 220 Ω resistors.
Before moving on to the next activity, restore your IR pairs to their original
configuration (with 1 kΩ resistors in series with each IR LED).
Also, before moving on, make sure to test this last change with
TestIrPairsAndIndicators.bs2 to verify that both IR LED/detector pairs are
working properly.
irDetectLeft
irDetectRight VAR
FREQOUT 8, 1, 38500
IR LED Series
Resistance, (Ω)
4700
2000
1000
470
220
Table 7-2:
VAR
Maximum Detection Distance,
Circle one: ( in / cm )
Detection Distance vs. Resistance
Bit
Bit

Related parts for 28125