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)

  • I believe that that site might help you; support.robotis.com/en/techsupport_eng.htm#product/dynamixel/… On the left menu, seek that menu path: Home > Software Help > Software development kit > Controller Embedded C
    – Sener
    Commented Apr 13, 2017 at 17:45
  • how to read position, and the hardware configuration ? pls help me
    – Hazel
    Commented Aug 21, 2018 at 10:15

1 Answer 1


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(){

Example moves servo and makes pauses of 2 sec.

Installation is easy:


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.
    – scottxiao
    Commented Apr 10, 2018 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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