[AIServo86]
描述
The list where all the servo positions are stored.
The first element of positions[] represents the AIServo position of the first channel, the second value represents the AIServo position of the second channel, and so on.
You can call attach() to specify the AIServo ID that positions[] corresponds to.
語法
aiservoframerobotis.positions[channel]
參數
aiservoframerobotis
: Variable of the AIServoFrameRobotis type.channel
: Range: 0 ~ 63, the value represents the nth channel of Servo.
If you are using load() to read RoboPlus Motion frame file, then the number of channels will be fixed to 26 groups, the Servo angles of the 0th to 25th group of channels are stored in positions[0], positions[1] … positions[25], after the 26th group, the contents of positions[] are all 0.
回傳
無
範例
#include <AIServo86.h> AIServoPort(ROBOTIS, AX12) bus; AIServo myservo0; AIServo myservo1; AIServo myservo2; AIServoFrameRobotis myframe; // Declare an AIServoFrameRobotis object void setup() { bus.begin(Serial1, 1000000); myservo0. attach(bus, 9); myservo1. attach(bus, 11); myservo2. attach(bus, 5); myframe.positions[0] = 180; // set Frame content myframe. positions[1] = 130; myframe. positions[2] = 200; // Set the time to rotate the servo to the position specified by Frame (myservo0 rotates to position[0] // position, myservo1 rotates to position[1], myservo2 rotates to position[2]) myframe.setPositions(500, myservo0, myservo1, myservo2); aiservoMultiRun(); // Rotate all servos according to the set value } void loop() {}
參考
函式庫參考主頁面
86Duino 參考的文本是根據 知識共享署名-相同方式分享 3.0 許可證,部分文本是從 Arduino 參考 修改的。 參考中的代碼示例已發佈到公共領域。