AIServoOffset constructor

Description

Initializes the AIServoOffset class.

Syntax

AIServoOffset myoffset

AIServoOffset myoffset(filename)

Parameters

filename: File name. When a file name is specified, the ServoOffset class will load the specified servo fine-tuning value file during initialization. Please note that this currently only supports downloading files 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 loading will fail.

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

#include <AIServo86.h>

 

AIServoPort(ROBOTIS, AX12) bus;

AIServo myservo1;

AIServo myservo2;

AIServo myservo3;

AIServoOffset myoffset("offset.txt"); // Load the file named from the SD card offset.txt servo trim value file

 

void setup()

{

  bus.begin(Serial1, 1000000);

  myservo1.attach(bus, 1);

  myservo2.attach(bus, 3);

  myservo3.attach(bus, 5);

 

  myoffset.setOffsets();

  myservo1.setPosition(100);

  myservo2.setPosition(150);

  myservo3.setPosition(200);

  aiservoMultiRun();

}

 

void loop() {}

See also

- offsets[]
- setOffsets()


Library Reference Home Page

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.