AIServo constructor

Description

Initializes the AIServo object.

Grammar

AIServo myservo

Parameters

None

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

#include <AIServo86.h>

 

AIServoPort(ROBOTIS, AX12) bus; // Initialize bus to control ROBOTIS AX-12 servo

AIServo myservo; // Initialize myservo

 

void setup()

{

  bus.begin(Serial1, 1000000); // Set the serial port used by the bus to Serial1 and the baud rate to 1000000

  myservo.attach(bus, 9); // Attach myservo to the bus, and myservo's ID is 9

  myservo.write(150); // Start the servo and rotate it to 150 degrees

}

 

void loop() {}

See also

attached()

write()


Library reference main 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.