AIServoFrameRobotis constructor

[AIServo86]

描述

Initialize the AIServoFrameRobotis class.

AIServoFrameRobotis is inherited from the AIServoFrame class and you can call the function members inside the AIServoFrame class such as positions[], setPositions(), playPositions(), save() to set, save or play the Frame directly.

語法

AIServoFrameRobotis myframe
AIServoFrameRobotis myframe(filename, motionname, step)

參數

  • filename: The name of the .mtn file generated by the RoboPlus Motion editor. When a filename is specified, the specified file will be loaded during the initialization of the AIServoFrameRobotis class. Please note that currently only the root directory of the SD card is supported for downloading files. If your 86Duino does not have an SD card on it or if the SD card does not contain the specified file, loading will fail.
  • motionname: the name of the Motion you want to load into the .mtn file.
  • step: the Step number of the Motion you want to read.

範例

#include <AIServo86.h>
 
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo0;
AIServo myservo1;
AIServo myservo2;
AIServoFrameRobotis myframe("test.mtn", "abc", 1); // Read Step 1 of abc in file test.mtn
 
void setup()
{
   bus.begin(Serial1, 1000000);
   myservo0. attach(bus, 21);
   myservo1. attach(bus, 23);
   myservo2. attach(bus, 25);
   myframe.playPositions(myservo0, myservo1, myservo2); // play action
}
 
void loop() {}

參考


函式庫參考主頁面

86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。

發表評論

上部へスクロール