Servo86.setVelocity()

[Servo86]

説明

Set the rotation speed of the servo when write()run() are called next time.

Please note that if you set the rotation time when you call setPosition(), the rotation speed set by this function will not have any effect.

Syntax

servo.setVelocity(value)

Parameters

  • servo: The variable of Servo type.
  • value: The speed of the servo, integer and floating point type values can be entered. When inputting an integer, the unit of rotation speed is us/s, for example, input 1000, which means 1000us of rotation per second. When a floating point number is entered, the unit of rotation speed is angle/s. For example, if 1.5 is entered, it means 1.5 degrees per second. If the input value is 0 or 0.0, it means the servo will rotate at the fastest speed.

Returns

None.

Example

#include <Servo86.h>
  
Servo myservo;
  
void setup()
{
   myservo.attach(9);
   myservo.write(1500); // Rotate the servo to 1500us angle
   myservo.setVelocity(1000); // set velocity 1000us/s
   myservo.write(900); // start the servo and turn to the 900us angle with a speed of 1000us/s
}
  
void loop() {}

See also


Libraries Reference Home

86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

コメントする

上部へスクロール