Provides an interface to an AX-12A servo. Requires the Dynamixel bus protocol library/

Fork of AX-12A by Jonathan Pickett

Revision:
2:f2da3b1d9988
Parent:
1:d7642b2e155d
Child:
5:bae6dc62dfb4
--- a/AX12.cpp	Tue Dec 15 04:37:54 2015 +0000
+++ b/AX12.cpp	Thu Dec 17 00:09:38 2015 +0000
@@ -18,6 +18,21 @@
 
 /*****/
 
+StatusCode AX12::SetServoId(char newId)
+{
+    int offset = ctID;
+    CommBuffer data;
+    data.push_back( newId );
+    StatusCode s = _pbus->Write(_ID, offset, data); 
+    if( s == statusValid )
+    {
+        _ID = newId;
+    }
+    return s;
+}
+
+/*****/
+
 StatusCode AX12::SetGoal(float degrees)
 {
     short goal = (short)((1024.0f * degrees) / 300.0f);
@@ -105,3 +120,4 @@
     int offset = ctTorqueEnable;
     return _pbus->Write(_ID, offset, data); 
 }
+