Datasheet

Chapter 8 Robot Control with Distance Detection
254Robotics with the BOE Shield-Bot
int ir = digitalRead(irReceiverPin); // IR receiver -> ir variable
delay(1); // Down time before recheck
return ir; // Return 1 no detect, 0 detect
}
Your Turn More Distance Tests
Try measuring the detection range for objects with different colors and textures.
Which colors and surfaces are easiest to detect? Which are most difficult?
Activity 2: BOE Shield-Bot Shadow Vehicle
For a BOE Shield-Bot to follow a leader-object, it has to know the rough distance to the
leader. If the leader is too far away, the sketch has to be able to detect that and move the
BOE Shield-Bot forward. Likewise, if the leader is too close, the sketch has to detect that and
move the BOE Shield-Bot backward. The purpose of the sketch is to make the BOE Shield-
Bot maintain a certain distance between itself and the leader-object.
Some Control System Vocabulary
When a machine is designed to automatically maintain a measured value, it generally
involves a control system. The value that the system is trying to maintain is called
the set point. Electronic control systems often use a processor to take sensor measurements
and respond by triggering mechanical actuators to return the machine to the set point.