save()

Description

Saves a user-defined robot motion frame (i.e., the positions[] array) to the specified file.

Syntax

servoframe.save(filename)

Parameters

servoFrame: A variable of type AIServoFrame.

filename: The name of the file. Please note that files are currently only saved to the root directory of an SD card. If your 86Duino does not have an SD card, the save will fail.

Return

true: The file was saved successfully.

false: The file failed to be saved.

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

#include <AIServo86.h>

 

AIServoPort(ROBOTIS, AX12) bus;

AIServoFrame myframe;

  

void setup()

  bus.begin(Serial1, 1000000);

  myframe.positions[0] = 180; //Set Frame content

  myframe.positions[1] = 130;

  myframe.positions[2] = 200;

  myframe.save("frm0.txt"); // Save the action frame to "frm0.txt"

}

  

void loop() {}

See also

- positions[]
- setPostions()
- load()


 

Library Reference Main 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.