Debugged library

Dependents:   MX106-finaltest dynamixel Arm_dynamixel_can Arm_dynamixel_can_procedurale

Fork of AX12_v2 by Team DIANA

Revision:
8:ae950cba6bc9
Parent:
7:ac233ac0ba11
Child:
11:9532fc2ca8b1
--- a/AX12.cpp	Fri Apr 29 13:22:00 2016 +0000
+++ b/AX12.cpp	Mon May 02 16:51:22 2016 +0000
@@ -64,7 +64,7 @@
     }
 
     // 1023 / 300 * degrees
-    short goal = (1023 * degrees) / 300;
+    short goal = (4093 * degrees) / 300;
     if (AX12_DEBUG) {
         printf("SetGoal to 0x%x\n",goal);
     }
@@ -112,7 +112,7 @@
     char data[2];
     
     // 1023 / 300 * degrees
-    short limit = (1023 * degrees) / 300;
+    short limit = (4093 * degrees) / 300;
 
     if (AX12_DEBUG) {
         printf("SetCWLimit to 0x%x\n",limit);
@@ -131,7 +131,7 @@
     char data[2];
 
     // 1023 / 300 * degrees
-    short limit = (1023 * degrees) / 300;
+    short limit = (4093 * degrees) / 300;
 
     if (AX12_DEBUG) {
         printf("SetCCWLimit to 0x%x\n",limit);
@@ -232,7 +232,7 @@
 
     int ErrorCode = read(_ID, AX12_REG_POSITION, 2, data);
     short position = data[0] + (data[1] << 8);
-    float angle = (position * 300)/1024;
+    float angle = (position * 300)/4093;
 
     return (angle);
 }