AIServo.pause()

[AIServo86]

説明

Suspend the rotating servo.

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

If you want to keep the suspended servo rotating, call resume().

Syntax

servo.pause()

Parameters

servo: Variable of the AIServo type.

Returns

None.

Example

#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 to the 150 degree position
   delay(600);
}
  
void loop()
{
   myservo.setPosition(280, 3000); // Set the target angle of the servo: 280 degrees, time: 3 seconds
   myservo. run();
   delay(1000);
   myservo.pause(); // The servo pauses
   delay(1000); // pause for 1 second
   myservo.resume(); // Servo resumes rotation
   delay(3000);
}

See also


Libraries Reference Home

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

コメントする

上部へスクロール