AIServoOffset constructor



Initializes the AIServoOffset class.


AIServoOffset myoffset
AIServoOffset myoffset(filename)


filename: The file name.
When a file name is specified, the specified servo trim value file will be loaded during the initialization of the ServoOffset category. Please note that currently, only files from the root directory of the SD card are supported. If your 86Duino is not equipped with an SD card, or if the SD card does not contain the specified file, loading will fail.


#include <AIServo86.h>
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo1;
AIServo myservo2;
AIServo myservo3;
AIServoOffset myoffset("offset.txt"); // Load the servo offset value file named offset.txt from the SD card
void setup()
   bus.begin(Serial1, 1000000);
   myservo1. attach(bus, 1);
   myservo2. attach(bus, 3);
   myservo3. attach(bus, 5);
   myoffset. setOffsets();
   myservo1. setPosition(100);
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