I want to find...

Search

Shares

Table of Content

AIServoOffset.load()

[AIServo86]

Description

Loads the robot’s AIServos offset from the specified file (i.e., reads the AIServo offset from the file and loads it into the offsets[] array).

Syntax

servooffset.load(filename)

Parameters

servooffset: variable of type AIServoOffset.

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 loading successfully.
  • false: File loading failed.

Example

#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"); // Load the robot motion trim value from the specified file
   myoffset.setOffsets(myservo0, myservo1, myservo2); // Set the fine-tuning value of the robot motion
}
 
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