Set the rotation speed of the servo.

Note that this function is only valid if the rotation time has not been set. If you have already called setPosition() to set the rotation time, the rotation speed set by this function will not have any effect.




  • servo: Variable of AIServo type.
  • value: If the set speed exceeds the limit of the servo, the servo will rotate at the fastest speed. If the value is 0 or 0.0, it means the servo will rotate at the fastest speed.




#include <AIServo86.h>
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo;
void setup()
   bus.begin(Serial1, 1000000);
   myservo. attach(bus, 9);
   myservo.write(150); // turn the servo to 150 degrees
   myservo.setVelocity(100); // set velocity to 100 degrees/second
   myservo.write(90); // Start the servo, turn it to 90 degrees at 100 degrees/second
void loop() {}

See also

Libraries Reference Home

The text of the 86Duino reference is a modification of the Arduino reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

Leave a Comment

Scroll to Top