AIServoFrameRobotis constructor

Description

Initializes the AIServoFrameRobot class. The AIServoFrameRobot inherits from the AIServoFrame class. You can directly call member functions within the AIServoFrame class, such as positions[], setPositions(), playPositions(), and save(), to set, save, or play the frame.

Syntax

AIServoFrameRobotis myframe AIServoFrameRobotis myframe(filename, motionname, step)

Parameters

filename: The name of the .mtn file generated by the RoboPlus Motion Editor. When a file name is specified, the specified file will be loaded during the initialization of the AIServoFrameRobotis class. Please note that this currently only supports downloading files from the root directory of an SD card. If there is no SD card inserted in your 86Duino, or if the specified file is not on the SD card, the loading will fail.

motionname: The name of the motion in the .mtn file to be loaded.

step: The number of steps in the motion to be read.

Example

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); // Read Step 1 of abc in the test.mtn file

 

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() {}

See also

load()


Library Reference Page

The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.