ServoOffset.load()

[Servo86]

Description

Load a file of servo offset trim values saved by the save() function. (After loading, the user can get the offset trim values for each servo in the offsets[] array.)

Syntax

myoffset.load(filename)

Parameters

  • myoffset: the object of ServoOffset type.
  • filename: The name of the offset fine-tuning (offset) file. Note: This function will only look for the offset trim file under the root directory of the SD card. If your 86Duino does not have an SD card inserted, or if no file is specified on the SD card, loading will fail.

Returns

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

Example

#include <Servo86.h>
 
Servo myservo0;
Servo myservo1;
Servo myservo2;
ServoOffset myoffset;
 
void setup()
{
   myservo0.attach(9);
   myservo1.attach(11);
   myservo2.attach(5);
 
   myoffset.load("offset0.txt"); // Load fine-tuning values from the specified file
   myoffset.setOffsets(myservo0, myservo1, myservo2); // Set the offset fine-tuning value of each servo
}
 
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