AIServoFrameRobotis constructor

説明

AIServoFrameRobot クラスを初期化します。AIServoFrameRobot は AIServoFrame クラスを継承します。AIServoFrame クラス内の positions[]setPositions()playPositions()save() などのメンバー関数を直接呼び出すことで、フレームを設定、保存、再生できます。

構文

AIServoFrameRobotis myframe AIServoFrameRobotis myframe(filename, motionname, step)

パラメータ

filename: RoboPlus Motion Editor によって生成される .mtn ファイルの名前。ファイル名を指定すると、AIServoFrameRobotis クラスの初期化時に指定されたファイルが読み込まれます。現在、SD カードのルートディレクトリからのファイルのダウンロードのみをサポートしています。86Duino に SD カードが挿入されていない場合、または指定されたファイルが SD カード上に存在しない場合、読み込みは失敗します。

motionname: 読み込む .mtn ファイル内のモーションの名前。

step: 読み込むモーションのステップ数。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

#include <AIServo86.h>

 

AIServoPort(ROBOTIS, AX12) bus;

AIServo myservo0;

AIServo myservo1;

AIServo myservo2;

AIServoFrameRobotis myframe("test.mtn", "abc", 1); // test.mtn ファイル内の abc のステップ 1 を読み取ります

 

void setup()

{

  bus.begin(Serial1, 1000000);

  myservo0.attach(bus, 21);

  myservo1.attach(bus, 23);

  myservo2.attach(bus, 25);

  myframe.playPositions(myservo0, myservo1, myservo2); // アクションを再生

}

 

void loop() {}

参照

load()


ライブラリリファレンスホームページ

86Duinoリファレンスのテキストは、Arduinoリファレンスを改変したもので、クリエイティブ・コモンズ 表示-継承 3.0 ライセンスに基づいて提供されています。リファレンスに含まれるコードサンプルはパブリックドメインとして公開されています。