i ripped the thread topic from a post on a related
forum.
my servo centers on boot. its a problem as every time i reset/boot the arduino the servos jump to mid-tilt position.
i tried
#include <Servo.h>
Servo panS;
Servo tiltS;
int tiltMin=60;
int panMin=0;
void setup()
{
panS.attach(9); // attaches the servo on pin 9 to the servo object
tiltS.attach(10);
//on wake up smoothly bring pan and tilt to start
for(int pos = 93; pos>=panMin; pos--) {
panS.write(pos);
delay(33);
}
for(int pos = tiltS.read(); pos>=tiltMin; pos--) {
tiltS.write(pos);
delay(33);
}
}
void loop()
{}
but if i try to servo.read() i always get 93. no matter the location.
i found this bit on an old documentation
pageSafety Quirk
Even though you attach a servo, it won't receive any control signals until you send its first position with the write() method to keep it from jumping to some odd arbitrary value.
but what help is that?
im surprised it hadn't been mentioned.
if i haven't searched enough please enlighten.
keywords: servo, jerk, startup, boot