Having Problem with speed and time setting

Hello All,

I’ve got a SSC-32 hooked up to a Arduino Mega running the code below. It should move the servo between it’s two extremes over two different time duration, however the time paramater never seems to do anything.

Neither does the speed command

Any advice? What am I missing?

Happy New Year!

Cheers

[code]void setup() {
Serial.begin(9600);
}

void loop() {
moveT(0, 900, 5000);
moveT(0, 2000, 500);

}
void moveT(int servo, int position, int time) {
Serial.print("#");
Serial.print(servo);//channel/servo number
Serial.print(" P");
Serial.print(position);//Pulse width 500-2500
Serial.print(" T");
Serial.println(time);
delay(time);
}
void moveS(int servo, int position, int speed) {
Serial.print("#");
Serial.print(servo);//channel/servo number
Serial.print(" P");
Serial.print(position);//Pulse width 500-2500
Serial.print(" S");
Serial.println(speed);
}[/code]

you may be restarting the loop over again thousands of times a second.

There is a delay() call in the moveT() function.

So what you see in your code below?

void loop() {
moveT(0, 900, 5000);
moveT(0, 2000, 500);

One thing I should mention, is the first move of a servo will not use the speed or time setting, as there is no way to find out were the servo is, so it will simply move to the first location as quick as it can… After the first move the SSC-32 knows where the servo should be, and it then uses the speed and time settings to move to the next location.

Kurt