Datasheet
Reading the feedback
The feedback signal is tapped off the position pot attached to the servo shaft. You can
connect the white feedback wire to any of the analog input pins and read the feedback value
using analogRead().
Calibrating the feedback
The raw feedback signal is a voltage. In order to convert that voltage into a meaningful position,
we need to calibrate it to the servo. By reading the feedback values at two known positions, we
can interpolate the expected feedback values for every position in between.
The following bit of code does just that. If you call "calibrate" in your setup function, it will
perform the calibration on the two points you specify. These servos operate over a range of
about 0 to 180 degrees. For maximum accuracy, you should choose the minPos and maxPos
calibration points based on the range of motion required in your project.
int feedback = analogRead(feedbackPin);
#include <Servo.h>
Servo myservo;
// Control and feedback pins
int servoPin = 9;
int feedbackPin = A0;
// Calibration values
int minDegrees;
int maxDegrees;
int minFeedback;
int maxFeedback;
© Adafruit Industries http://learn.adafruit.com/analog-feedback-servos Page 7 of 12