[AIServo86]
説明
Initialize the AIServoPort class.
構文
AIServoPort(Vendor, Servo) bus
媒介変数
Vendor: The vendor of the servo that this bus wants to mount. Example: ROBOTIS.Servo: The model of the servo to be mounted on this bus. For example: AX12, RX28, MX28, XL320.
例
#include <AIServo86.h>
AIServoPort(ROBOTIS, AX12) bus; // Initialize bus to control ROBOTIS AX-12 servo
AIServo myservo; // initialize myservo
void setup()
{
bus.begin(Serial1, 1000000); // Set the serial port used by the bus as Serial1, and the baud rate as 1000000
myservo.attach(bus, 9); // mount myservo to the bus, and the ID of myservo is 9
myservo.write(150); // start the servo and turn it to 150 degrees
}
void loop() {}参照
ライブラリリファレンスホーム
86Duinoリファレンスのテキストは、Arduinoリファレンスを改変したもので、Creative Commons Attribution-ShareAlike 3.0ライセンスに基づいてライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。