Datasheet

Assemble and Test your BOE Shield-Bot • Chapter 3
Robotics with the BOE Shield-Bot 87
servoRight.attach(12); // Attach right signal to pin 12
servoRight.writeMicroseconds(1300); // Right wheel clockwise
delay(3000); // ...for 3 seconds
servoRight.writeMicroseconds(1500); // Stay still
delay(1000); // ...for 3 seconds
servoRight.writeMicroseconds(1700); // Right wheel counterclockwise
delay(3000); // ...for 3 seconds
servoRight.writeMicroseconds(1500); // Right wheel counterclockwise
}
void loop() // Main loop auto-repeats
{ // Empty, nothing needs repeating
}
Your Turn Testing the Left Wheel
Now, it’s time to run the same test on the left wheel as shown below. This involves
modifying the RightServoTest sketch.
Save RightServoTest as LeftServoTest.
Change
Servo servoRight to Servo servoLeft.
Change
servoRight.Attach(12) to servoLeft.Attach(13).
Replace the rest of the
servoRight references with servoLeft.
Save the modified sketch, and run it on your Arduino.
Verify that it makes the left servo turn clockwise for 3 seconds, stop for 1 second,
then turn counterclockwise for 3 seconds.
If the left wheel does not behave as predicted, see Servo Troubleshooting below.
Clockwise 3 seconds
Stop 1 second
Counterclockwise 3 seconds