Robotis Dynamixel MX-12W Servo Library

Dependents:   SpindleBot_1_5b Utilisatio_MX12_V4

/media/uploads/labmrd/mx12.jpg

This is my attempt to adapt Chris Styles's AX12 library to work with my Dynamixel MX12 servos. This library is still very much a work in progress, and it may have some/many errors in it, but hopefully I will keep improving it to bring it up to snuff.

Dynamixel aficionados should also check out This MX28 library for a completely separate library that provides very similar functionality, and I wish I had known it existed before I started my work...

minimal example

#include "mbed.h"
#include "MX12.h"

int main() {

  MX12 mymx12 (p9, p10, 1);           // ID=1

  while (1) {
      mymx12.Set_Goal_Position(0);    // go to 0 degrees
      wait (2.0);
      mymx12.Set_Goal_Position(300);  // go to 300 degrees
      wait (2.0);
  }
}

Files at this revision

API Documentation at this revision

Comitter:
labmrd
Date:
Thu Jan 29 22:24:13 2015 +0000
Parent:
3:624d04c390b8
Child:
5:4c118a827f11
Commit message:
More output on scan

Changed in this revision

MX12.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MX12.cpp	Thu Jan 29 22:23:20 2015 +0000
+++ b/MX12.cpp	Thu Jan 29 22:24:13 2015 +0000
@@ -125,8 +125,10 @@
         int baud_rate[12]={3000000,2500000,2250000,1000000,500000,400000,250000,200000,115200,57600,19200,9600};
         char ii;
         for(ii=0;ii<12;ii++){
+            printf("baud rate=%d\n",baud_rate[ii]);
             ChangeUARTBaud(baud_rate[ii]);
             for(ID_Num=0;ID_Num<=max_id;ID_Num++){
+                printf("ID Num=%d\n",ID_Num);
                 if(ping(ID_Num)){
                     printf("Found a servo at ID=%#02x, Baud=%d\n",ID_Num,baud_rate[ii]);
                 }