1

I want to controll two dynamixel ax-12 servos using a arduino mega and I don`t know the commands that I should send to them using Serial.

Could anyone help me with this? (And please keep in mind that I don`t want any more hardware. Just arduino board)

2

With Dynamixel library you can use servo this easily:

#include <DynamixelSerial.h>

void setup(){
   Dynamixel.begin(1000000,2);  // Inicialize the servo at 1Mbps and Pin Control 2
}

void loop(){
    Dynamixel.move(1,0);
    delay(2000);
    Dynamixel.move(1,500);
    delay(2000);
    Dynamixel.move(1,1000);
    delay(2000);
}

Example moves servo and makes pauses of 2 sec.

Installation is easy:

Installation:

Copy the files from DynamixeSerial to your IDE libraries folder.

DynamixelSerial folder can be found here: https://sourceforge.net/projects/dynamixelforarduino/files/?source=navbar

  • But how to connect the arduino and servo?The servo requires half-duplex serial port,but arduino is uart.I want to control the servo and also read the data from it. – bigxiao Apr 10 '18 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.