ServoOffsetVstone constructor

Description

Initializes the ServoOffsetVstone class. ServoOffsetVstone inherits from the ServoOffset class and can load offset fine-tuning values from an action profile generated by the RobovieMaker2 action editor.

Syntax

ServoOffsetVstone myoffset
ServoOffsetVstone myoffset(filename, offset_name)

Parameters

filename: The name of the .ini action configuration file generated by RobovieMaker2.

offset_name: The name of the offset fine-tuning value (Offset) in the RobovieMaker2 action configuration file (available in RobovieMaker2).

If both of these parameters are entered, the ServoOffsetVstone class will automatically load the offset fine-tuning value from the file as the initial value when it is initialized. Please note that you must place the file in the root directory of the SD card. If your 86Duino is not installed on the SD card, or the SD card does not contain the motion file, the file 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

24

25

#include <Servo86.h>

 

Servo myservo1;

Servo myservo2;

Servo myservo3;

 

// Load the offset fine-tuning value named Offset 0 from the vstone_offset.ini configuration file on the SD card

ServoOffsetVstone myoffset("vstone_offset.ini", "Offset 0");

 

void setup()

{

  myservo1.attach(21);

  myservo2.attach(23);

  myservo3.attach(25);

 

  // Set the compensation amount for the center position error of each servo

  myoffset.setOffsets(myservo1, myservo2, myservo3);

  

  myservo1.setPosition(1000);

  myservo2.setPosition(1500);

  myservo3.setPosition(2000);

  servoMultiRun(); // Rotate each servo (will automatically compensate for servo center position errors)

}

 

void loop() {}

See also

- offsets[]
- setOffsets()


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.