[AIServo86]
説明
Set up and enable AIServoPort.
構文
bus.begin(HardwareSerial, Baudrate)
媒介変数
bus
: Variable of the AIServoPort type.HardwareSerial
: The port to communicate with the servo. For example, Serial1 and Serial485.Baudrate
: The baud rate used for communication. e.g., 115200, 1000000.
例
#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() {}
See also
Libraries Reference Home
86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。