Datasheet
BOE Shield-Bot Navigation • Chapter 4
Robotics with the BOE Shield-Bot • 127
{
servoLeft.detach(); // Stop servo signals
servoRight.detach();
}
delay(msTime); // Delay for msTime
}
Your Turn – Customize Speed and Duration Control
With the maneuver function, 0 is stop, 100 to –100 is the speed control range, and 200
and -200 are overkill to keep the servos running as fast as they possibly can.
The TestManeuverFunction sketch makes it easy to define custom maneuvers quickly. Just
pass new parameters for each wheel rotation and maneuver duration to each call of
the
maneuver function. For example, let’s make the left wheel move at half speed while the
right wheel moves at full speed to draw an arc for 3 seconds. Here is what that function call
would look like:
maneuver(50, 100, 3000);
Here is another example that keeps the left wheel still and moves the right wheel forward for
a left pivot turn:
maneuver(0, 200, 1200);
Try adding both of the example maneuver calls to your sketch.
Try adding the other three wheel-pivot turns to the sequence: forward-right,
backward-right, and backward-left.
Activity 7: Maneuver Sequences with Arrays
Some robotics applications require sequences of maneuvers. You’ll actually see some simple
sequence examples in the next chapter when the BOE Shield-Bot detects that it has bumped
into an obstacle. At that point, it has to back up, and then turn before trying to go forward
again. That is a simple sequence with two maneuvers.
Another example is corridor navigation. The BOE Shield-Bot might have to find a corridor
and then go through a sequence of maneuvers to enter it, before searching for the corridor’s
walls.
Other sequences can be more elaborate. One example of a long and complex maneuver
would be for a robotic dance contest. (Robot dance contests have been gaining popularity in
recent years.) For dancing to an entire song, the robot might need a pretty long list of