attach()

描述

掛載 AIServo。

語法


servo.attach(bus, ID)

參數

servoAIServo 型別的變數。

bus:AIServoPort(Vendor, Servo) 宣告產生之物件。
ID:伺服機之 ID。

回傳

範例

#include <AIServo86.h> 

AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo;

void setup() 
{ 
  bus.begin(Serial1, 1000000);
  myservo.attach(bus, 9); // 將 myservo 掛載至 bus,且 myservo 的 ID 為 9
} 

void loop() {} 

See also

attached()
detach()


函式庫參考主頁面

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.