[Servo86]
説明
Stops the servo rotation.
When you call this function, the servo will stop at the current position immediately. The behavior of this function is different from pause(), you cannot resume the servo by resume(), you must reset the target position and call run(), or call write() または writeMicroseconds() to make the servo rotate again.
Please note that the servo will still produce power when it is stopped, so please do not turn the servo by hand, otherwise the servo will be damaged.
構文
servo.stop()
媒介変数
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 myservo.run(); // start the servo delay(100); myservo.setPosition(1800, 3000); // Set the target angle of the servo: 1800us, time: 3 seconds myservo.run(); delay(2000); // make the servo spin for 2 seconds myservo.stop(); // stop the servo } void loop() {}
See also
- setPosition()
run() - pause()
- resume()
Libraries Reference Home
86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。