release()

描述

釋放一個指定的伺服機,呼叫此函式後,伺服機會立即停止出力。

釋放後的伺服機,會回到 attach() 時的狀態,您必須再次設定目標角度,然後呼叫 run()write() 其中之一才能讓伺服機開始轉動。

語法


servo.release()

參數

servoAIServo 型別的變數。

回傳

範例

#include <AIServo86.h> 

AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo;

void setup() 
{ 
  bus.begin(Serial3, 1000000);
  myservo.attach(bus, 3);
  myservo.write(150);  // 將伺服機轉到 150 度
  delay(3000); // 延遲 3 秒
  myservo.release(); // 釋放伺服機
} 

void loop() {} 

See also

attach()
setPosition()
pause()
run()


函式庫參考主頁面

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.