resume()
描述
恢復暫停中的伺服機,使伺服機繼續往目標角度轉動。
語法
servo.resume()
參數
servo
:AIServo
型別的變數。
回傳
無
範例
#include <AIServo86.h> AIServoPort(ROBOTIS, AX12) bus; AIServo myservo; void setup() { bus.begin(Serial3, 1000000); myservo.attach(bus, 3); myservo.write(150); // 將伺服機轉到 150 度的位置 delay(100); } void loop() { myservo.setPosition(280, 3000); // 設定伺服機的目標角度:280 度,時間:3 秒 myservo.run(); delay(1000); myservo.pause(); // 伺服機暫停轉動 delay(1000); // 暫停 1 秒 myservo.resume(); // 伺服機恢復轉動 delay(3000); }
See also
- attach()
- setPosition()
- pause()
The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.