Servo86.pause()

[Servo86]

説明

Suspend the servo rotation.

Please note that the servo will still be rotating 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, please call resume().

構文

servo.pause()

媒介変数

servo: Variable of the servo type.

戻り値

なし

#include <Servo86.h>
  
Servo myservo;
  
void setup()
{
   myservo.attach(9);
   myservo.write(1500); // turn the servo to the initial position of 1500us
   delay(100);
}
  
void loop()
{
   myservo.setPosition(1800, 3000); // Set the target angle of the servo: 1800us, time: 3 seconds
   myservo.run();
   delay(1000);
   myservo.pause(); // Servo pauses rotation
   delay(1000); // pause for 1 second
   myservo.resume(); // Servo resumes rotation
   delay(3000);
}

参照


ライブラリリファレンスホーム

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

上部へスクロール