FIGURE 11. The GP2Y0D810 infrared distance judgement sensor, mounted on the
front of the Beginner Bot on a homemade bracket.
The mounted IR detector is
shown in Figure 11.
See Listing 4 for a
demonstration of using the
Beginner Bot with the switch and
infrared object detection sensors.
This program — like the rest —
requires the use of separate
object library files. They’re
included with the file download
from the SERVO website.
The program first reads the
current output of the bumper
switch. If it’s HIGH, the switch
has been triggered. The robot
reacts by momentarily backing
up, turning to the right, and then
proceeding forward again.
Next comes a test to see if
the IR detector has been
activated. If it’s LOW, there’s an
object within its field of view
by Steven Nelson
I had just got back from the 2011 Maker Faire in
San Mateo, CA., and was excited about the
huge bunch of cool machines running with the
Arduino microcontroller. So, of course, I had to
purchase one. I bought the Arduino Mega
2560. I had never used an Arduino before,
but was familiar with other microcontrollers
such as the Parallax BASIC Stamp 2 and the
54 SERVO 12.2011