setOffsets()

Description

Assign an offset list to each servo.

Grammar

servooffsetvstone.setOffsets()
servooffsetvstone.setOffsets(servo1)
servooffsetvstone.setOffsets(servo1,servo2)
servooffsetvstone.setOffsets(servo1,servo2, … ,servo45)

Parameters

servooffsetvstone: Variable of type ServoOffsetVstone

servo1 ~servo45: Variable of type Servo.

Postback

None

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

#include <Servo86.h>

 

Servo  myservo0;

Servo  myservo1;

Servo  myservo2;

ServoOffsetVstone myoffset;

 

void setup()

{

  myservo0.attach(9); myservo1.attach(11); myservo2.attach(5);

  myoffset.offsets[0] = -200; // Set the offset value

  myoffset.offsets[1] = 50;

  myoffset.offsets[2] = -100;

  // Assign the offset value to the servo (offsets[0])

  // , offsets[1] is set to myservo1, offsets[2] is set to myservo2)

  myoffset.setOffsets(myservo0, myservo1, myservo2);

}

 

void loop() {}

Reference

Offset[]


Library Reference Home

The text in the 86Duino Reference is adapted from Arduino Reference and is licensed under the Creative Commons Attribution-ShareAlike 3.0 License. Code examples within the reference are released into the public domain.