Datasheet
Shield, Lights, Servo Motors • Chapter 2
Robotics with the BOE Shield-Bot • 69
Pulse Width Modulation: Adjusting the property of a signal to carry information is
called modulation. We’ve discovered that servo control signals are a series of high pulses
separated by low resting states. How long the high pulse lasts—how wide the high pulse looks in a
timing diagram—determines the speed and direction that the servo turns. That adjustable pulse
width carries the servo setting information. Therefore, we can say that servos are controlled
with pulse width modulation
, abbreviated PWM.
Save a copy of the ServosOppositeDirections sketch as TestServosTable2_2.
Test each combination of values in
servoLeft.WriteMicroseconds(us)
and
servoRight.writeMicroseconds(us) and record your results in the table.
writeMicroseconds(us) Combinations
Pin 13
servoLeft
Pin 12
servoRight
Description Behavior
1700 1300
Full speed, pin 13 servo counter-
clockwise, pin 12 servo clockwise.
1300 1700
1700 1700
1300 1300
1500 1700
1300 1500
1500 1500
Both servos should stay still. Robot stays still.
1520 1480
1540 1460
1700 1450
1550 1300