Datasheet

Page 82ยท Applied Robotics with the SumoBot
Figure 3-3
Opponent Detected
at Front-Right
Example Program - TestFRontIrObjectDetectors.bs2
โˆš Enter, save, and run TestFrontIrObjectDetectors.bs2.
โˆš Point your SumoBot away from nearby objects. It may actually detect walls as
far as 1 to 2 m away. If your detectors are pointing slightly downward, they will
also detect the floor, so point the IR LEDs level to the ground, or even slightly
upward if needed.
โˆš Pass your other SumoBot across your test SumoBot's field of vision at a distance
of 10 cm. As you do so, starting from left to right, the readings displayed by the
Debug Terminal should be 00, 10, 11, 01, 00.
Trouble-Shooting
If 0 is always displayed, check your wiring and program for errors. Make sure your IR LED
is not connected with the wrong polarity. Like normal LEDs, the IR LED is a 1-way current
valve, and won't emit infrared light if it's plugged in the wrong way. The shorter of the IR
LEDs two pins is the cathode terminal, and it should be connected to Vss. If the pins have
been trimmed, you can still identify the cathode terminal by locating the flat spot on the
LED's clear plastic case. The pin closest to this flat spot is the cathode terminal.
If 1 is always displayed, try pointing your SumoBot in a direction where there are no objects
for several meters. If this doesn't work, also check your wiring and program.