サイト内検索

検索

Shares

Table of Content

AIServo.run()

[AIServo86]

説明

Start the servo (i.e., the servo starts to produce power).

If you have already called setPosition() to set the target angle, the servo will start to rotate to the angle you set.

Please note that since this function will make the servo start immediately, please avoid turning the servo by hand to avoid injury or damage to the servo.

構文

servo.run()

媒介変数

servo: Variable of the AIServo type.

戻り値

なし

#include <AIServo86.h>
  
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo;
  
void setup()
{
   bus.begin(Serial3, 1000000);
   myservo. attach(bus, 3);
   myservo.setPosition(200); // Set to rotate to 200 degrees at the fastest speed
   myservo.run(); // turn the servo
   delay(1000);
   myservo.setPosition(100, 1000); // set to turn to 100 degrees, it takes 1 second
   myservo.run(); // start the servo
   while(myservo. isMoving());
}
  
void loop() {}

See also


Libraries Reference Home

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

上部へスクロール