サイト内検索

検索

Shares

Table of Content

AIServoFrame.positions[]

[AIServo86]

説明

The first element of position[] represents the AIServo angle of the first channel, and the second element represents the Servo angle of the second channel.

The first element of position[] represents the AIServo angle of the first channel, the second element represents the AIServo angle of the second channel, and so on.

Up to 64 channels of Servo angle can be specified.

構文

servoframe.positions[channel]

媒介変数

  • servoframe: Variable of AIServoFrame type.
  • channel: range: 0 ~ 63, its value represents the nth channel of Servo; please see the example below.

戻り値

なし

#include <AIServo86.h>
  
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo0;
AIServo myservo1;
AIServo myservo2;
AIServoFrame myframe; // declare a Frame 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() {}

See also


Libraries Reference Home

86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

上部へスクロール