I have just started a project that i need a servo to turn at the same time that a potentiometer turns. So i got myself an Arduino Duemilanove and i have hooked it up to my servo i had.
The first servo i used was a Futaba S3003 and it was way to slow ( but very accurate ) So i went out and purchased a Align DS610, this servo is very fast but it judders and is not very precise. Not sure if its the 10K potentiometer i am using.
Any tips on how i can make it smoother?
i am using the code that comes with the Arduino software!
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
myservo.attach(9); // attaches the servo on pin 9 to the servo object
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(0); // waits for the servo to get there