load()

Description

Loads the robot's AIServo offsets from the specified file (i.e., reads the AIServo offsets from the file and loads them into the offsets[] array).

Syntax

servooffset.load(filename)

Parameters

servooffset: A variable of type AIServoOffset.

filename: The name of the file. 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.

Return

true: File loaded successfully.

false: File loaded failed.

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;

AIServoOffset myoffset;

 

void setup()

{

  bus.begin(Serial1, 1000000);

  myservo0.attach(bus, 9);

  myservo1.attach(bus, 11);

  myservo2.attach(bus, 5);

  myoffset.load("offset0.txt"); // Loads robot motion fine-tuning values from the specified file.

  myoffset.setOffsets(myservo0, myservo1, myservo2); // Sets robot motion fine-tuning values.

}

 

void loop() {}

See also

- offsets[]
- setoffsets()
- save()


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.