[AIServo86]
描述
Set the offsets[] array value to the corresponding servo.
語法
servooffset.setOffsets()
servooffset.setOffsets(servo1)
servooffset.setOffsets(servo1, servo2)
servooffset.setOffsets(servo1, servo2, ... , servo64)
參數
servooffset
: Variable of AIServoOffset type.servo1 ~ servo64
: Variable of AIServo type.
回傳
無
範例
#include <AIServo86.h> AIServoPort(ROBOTIS, AX12) bus; AIServo myservo0; AIServo myservo1; AIServo myservo2; AIServoOffset myoffset; void setup() { bus.begin(Serial1, 1000000); myservo0. attach(bus, 9); myservo1. attach(bus, 11); myservo2. attach(bus, 5); myoffset.offsets[0] = -20; // Set Offset content myoffset.offsets[1] = 5; myoffset.offsets[2] = -10; // assign the value of Offset to the servo (the value of offsets[0] is assigned to myservo0 // , the value of offsets[1] is assigned to myservo1, and the value of offsets[2] is assigned to myservo2) myoffset.setOffsets(myservo0, myservo1, myservo2); } void loop() {}
參考
- offsets[]
函式庫參考主頁面
86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。