AIServoFrame constructor

Description

Initializes the AIServoFrame class.

Syntax

AIServoFrame myframe

AIServoFrame myframe(filename)

Parameters

filename: File name. When a file name is specified, the specified motion frame file will be loaded during the AIServoFrame class initialization process.

Please note that currently only files downloaded from the root directory of an SD card are supported. 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.

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

#include <AIServo86.h>

 

AIServoPort(ROBOTIS, AX12) bus;

AIServo myservo1;

AIServo myservo2;

AIServo myservo3;

AIServoFrame myframe("frame.txt"); // Load the action frame file named frame.txt from the SD card

 

void setup()

{

  bus.begin(Serial1, 1000000);

 

  myservo1.attach(bus, 1);

  myservo1.attach(bus, 3);

  myservo1.attach(bus, 5);

   

  myframe.positions[0] = 150;

  myframe.positions[1] = 180;

  myframe.positions[2] = 200;

 

  myframe.setPositions();

  aiservoMultiRun();

}

 

void loop() {}

See also

- positions[]
- setPositions()


Library Reference Home

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.