Speed of Servo

hello here I`m new here my name is Rob living in the Netherlands.

but i have a question.

i want to make a turning table for my trains but the speed of the servo how do i control that ?
i included the files.

and is there a possibility when the servo is turnig, the led for that button is turned on and when the turning table (servo) is on position the led go off

thanks in advance
Rob

Draaischijf.ino (957 Bytes)

Servos go as fast as they can to where you tell them to go. If you want them to go slow, you basically need to calculate where they should be at any time and send a bunch of timed positions out to them.

For an example of this.. You can map an analog signal (10k POT) to servo position and it'll follow that signal very smoothly. Because its getting positions very fast that are close together.

For a turntable you need to calculate positions for acceleration, max velocity then de-acceleration, stopping at your end point. Then, feed those positions in at about one every 10ms

Or not..

-jim lee

Or you could just use VarSpeedServo.h instead of Servo.h and set the speed using the parameter in the write() command. And if you use the wait parameter you can switch LED on, do the write, then switch the LED off.

Steve