load()

Description

Loads the .mtn frame file generated by the RoboPlus Motion Editor.

Syntax

aiservoframerobotis.load(filename, motionname, step)

Parameters

aiservoframerobotis: Variable of type AIServoFrameRobotis.

filename: Name of the .mtn file generated by the RoboPlus Motion Editor. Please note that currently only files can be downloaded 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 download will fail.

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

framename: The number of steps in the motion to be loaded.

Return

true: The file was loaded successfully. False: The file failed to load.

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

#include <AIServo86.h>

  

AIServoPort(ROBOTIS, AX12) bus;

AIServo myservo0;

AIServo myservo1;

AIServo myservo2;

AIServoFrameRobotis myframe;  

 

void setup()

{

  bus.begin(Serial1, 1000000);

  myservo0.attach(bus, 9);

  myservo1.attach(bus, 11);

  myservo2.attach(bus, 5);

  //Read Frame 0 of Sequence  0 in the Pololu Frame file

  myframe.load("test.mtn", "abc", 1);

  myframe.playPositions(myservo0, myservo1, myservo2); // Play action

}

  

void loop() {}

See also

- positions[]
- setPositions()
- save()


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.