Datasheet
Chapter 7 • Navigating with Infrared Headlights
238 • Robotics with the BOE Shield-Bot
Your Turn
Save FastIrRoaming as FastIrRoamingYourTurn.
Add code to make the LEDs indicate that the BOE Shield-Bot has detected an
object.
Try modifying the values that
speedLeft and speedRight are set to so that the
BOE Shield-Bot does everything at half speed. (Remember that 200 and -200 are
overkill, so try 50 for half speed forward and –50 for half speed backward).
Activity 6: Drop-off Detector
Up until now, your robot has mainly been programmed to take evasive maneuvers when an
object is detected. There are also applications where the BOE Shield-Bot must take evasive
action when an object is not
detected. For example, if the BOE Shield-Bot is roaming on a
table, its IR detectors might be looking down at the table surface. The sketch should make it
continue forward so long as both IR detectors can “see” the surface of the table.
Disconnect power and programming cable.
Point your IR object detectors downward and outward as shown below.
Recommended Materials:
(1) Roll of black vinyl electrical tape, ¾″ (19 mm) wide, or black tempera paint and brush.
(1) Sheet of white poster board, 22 x 28 in (56 x 71 cm).
Simulating a Drop-Off with Poster Board
A sheet of white poster board with a border made of electrical tape or black tempera paint
makes for a handy way to simulate the drop-off presented by a table edge, with much less
risk to your BOE Shield-Bot.