In this activity, you will run a sketch that sends the “stay-still” signal to the servos. You will then use a screwdriver to adjust the servos so that they actually stay still. This is called centering the servos. After the adjustment, you will run test sketches that will turn the servos clockwise and counterclockwise at various speeds.
You’ll need a Phillips #1 point screwdriver with a 1/8″ (3.18 mm) or smaller shaft.
If a servo has not yet been centered, it may turn, vibrate, or make a humming noise when it receives the “stay-still” signal.
What’s a Potentiometer?
A potentiometer is kind of like an adjustable resistor with a moving part, such as a knob or a sliding bar, for setting the resistance. The Parallax continuous rotation servo’s potentiometer is a recessed knob that can be adjusted with a small Phillips screwdriver tip. Learn more about potentiometers in What’s a Microcontroller? and Basic Analog and Digital at www.parallax.com.
/* Robotics with the BOE Shield – RightServoStayStill Transmit the center or stay still signal on pin 12 for center adjustment. */ #include <Servo.h> // Include servo library Servo servoRight; // Declare right servo void setup() // Built-in initialization block { servoRight.attach(12); // Attach right signal to pin 12 servoRight.writeMicroseconds(1500); // 1.5 ms stay still signal } void loop() // Main loop auto-repeats { // Empty, nothing needs repeating }