Datasheet

Chapter 4 • BOE Shield-Bot Navigation
144Robotics with the BOE Shield-Bot
Project Solutions
1. Solution (though the table looks a little different than the one you may have
printed out.)
Servo ports
connected to:
Description Behavior
Pin 13 Pin 12
1700 1300 Full Speed: pin 13 CCW, Pin 12 CW Forward
1300 1700 Full Speed: Pin 13 CW, Pin 12 CCW Backward
1700 1700 Full Speed: Pin 13 CCW, Pin 12 CCW Right rotate
1300 1300 Full Speed: Pin 13 CW, Pin 12 CW Left rotate
1500 1700 Pin 13 Stopped, Pin 12 CCW Full speed Pivot back left
1300 750 Pin 13 CW Full Speed, Pin 12 Stopped Pivot back right
1500 1500 Pin 13 Stopped, Pin 12 Stopped Stopped
1520 1480 Pin 13 CCW Slow, Pin 12 CW Slow Forward slow
1540 1460 Pin 13 CCW Med, Pin 12 CW Med Forward medium
1700 1450 Pin 13 CCW Full Speed, Pin 12 CW Medium Veer right
1550 1300 Pin 13 CCW Medium, Pin 12 CW Full Speed Veer left
2. The circle can be implemented by veering right continuously. Trial and error,
and a yard or meter stick, will help you arrive at the right
us parameters
for
writeMicroseconds(us) and the right ms parameter for delay(ms). Below
is a solution that worked for a particular pair of servos and set of batteries. Your
values may vary considerably from what’s in the Circle sketch.
// Robotics with the BOE Shield - Chapter 4, project 2 - Circle
// BOE Shield-Bot navigates a circle of 1 yard diameter.
#include <Servo.h> // Include servo library
Servo servoLeft; // Declare left and right servos
Servo servoRight;
void setup() // Built-in initialization block