resume()

描述

使暫停中的伺服機繼續轉動。

語法


servo.resume()

參數

servoServo 型別的變數。

回傳

範例

#include <Servo86.h> 
 
Servo myservo;
 
void setup() 
{ 
  myservo.attach(9);
  myservo.write(1500);  // 將伺服機轉到 1500us 初始位置
  delay(100);
} 
 
void loop()
{
  myservo.setPosition(1800, 3000); // 設定伺服機的目標角度:1800us,時間:3 秒
  myservo.run();
  delay(1000);
  myservo.pause(); // 伺服機暫停轉動
  delay(1000); // 暫停 1 秒
  myservo.resume(); // 伺服機恢復轉動
  delay(3000);
} 

See also

setPosition()
run()
pause()


函式庫參考主頁面

The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.