サイト内検索

検索

Shares

Table of Content

AIServo.stop()

[AIServo86]

説明

Stop the rotating servo. When this function is called, the servo will stop spinning at the current position, and the target angle and time set will be cleared, and the current angle will be considered as the target angle.

The behavior of this function is different from pause(), you cannot resume the servo by resume(), you have to reset the target angle and call one of run() 入力と write() to start the servo.

Please note that the servo will still be rotating after stopping, so please do not rotate it by hand, otherwise the servo will be damaged.

構文

servo.stop()

媒介変数

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.write(150); // turn the servo 150 degrees
   myservo.run(); // start the servo
   delay(600);
}
 
void loop()
{
   myservo.setPosition(280, 2000); // Set the target angle of the servo: 280 degrees, time: 2 seconds
   myservo. run();
   delay(1000); // make the servo rotate for 1 second
   myservo.stop(); // stop the servo
   while(1);
}

See also


Libraries Reference Home

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

上部へスクロール