By updating the servo motor positions every 10ms or 20ms, it is possible to calculate at what speed the servo should be at which position.
An examples of that is this:
It uses a millis-timer and the Arduino Servo library. There should be no long delays in the loop().
The varSpeedServo uses a interrupt and generates the servo signal directly without the Servo libray.
You could try both ![]()
There are maybe 20 servo libraries to do more things than the Arduino Servo library.