attach()

Description

Attaches the AIServo.

Syntax

servo.attach(bus, ID)

Parameters

servo: A variable of type AIServo.

bus: The object declared by the AIServoPort(Vendor, Servo).

ID: The ID of the servo.

Postback

None

Example

1

2

3

4

5

6

7

8

9

10

11

12

#include <AIServo86.h>

 

AIServoPort(ROBOTIS, AX12) bus;

AIServo myservo;

 

void setup()

{

  bus.begin(Serial1, 1000000);

  myservo.attach(bus, 9); // Mount myservo to bus, and the ID of myservo is 9

}

 

void loop() {}

See also

attached()

detach()


Library Reference Home

The text in the 86Duino reference material is modified from the Arduino reference material and is licensed under the Creative Commons Attribution-Share Alike 3.0 License . The code examples in the reference material have been released into the public domain.