AIServo 建構子

描述

初始化 AIServo 物件。

語法


AIServo myservo

參數

範例

#include <AIServo86.h> 

AIServoPort(ROBOTIS, AX12) bus; // 初始化 bus 來控制 ROBOTIS AX-12 伺服機
AIServo myservo; // 初始化 myservo

void setup() 
{ 
  bus.begin(Serial1, 1000000); // 設定 bus 使用的序列埠為 Serial1,baud rate 為 1000000
  myservo.attach(bus, 9); // 將 myservo 掛載至 bus,且 myservo 的 ID 為 9
  myservo.write(150); // 啟動伺服機並轉到 150 度
} 

void loop() {} 

See also

attached()
write()


函式庫參考主頁面

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.