AIServoFrame.load()

[AIServo86]

Description

Load user-defined robot action frames from the specified file (i.e. save the action frames in the file to the positions[] array).

Syntax

servoframe.load(filename)

Parameters

  • servofame: Variable of the AIServoFrame type.
  • filename: the name of the file. 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 files, loading will fail.

Returns

  • true: File was loaded successfully.
  • false: File loading failed.

Example

#include <AIServo86.h>
  
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo1;
AIServo myservo2;
AIServo myservo3;
AIServoFrame myframe;
  
void setup()
{
   bus.begin(Serial1, 1000000);
   myservo1. attach(bus, 9);
   myservo2. attach(bus, 11);
   myservo3. attach(bus, 5);
   myframe.load("frm0.txt"); // Load the robot action frame from the specified file
   myframe.playPositions(500, myservo1, myservo2, myservo3); // play this Frame for 500 ms
}
  
void loop() {}

See also


Libraries 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.

Leave a Comment

Scroll to Top