d

Dependencies:   AX12_final MX106_not_working comunication_1 mbed-dev

Fork of MX106-finaltest by Team DIANA

Files at this revision

API Documentation at this revision

Comitter:
clynamen
Date:
Thu Nov 24 15:29:50 2016 +0000
Parent:
11:19e8022f60ea
Commit message:
dynamixel

Changed in this revision

MX.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-dev.lib Show annotated file Show diff for this revision Revisions of this file
mbed-src.lib Show diff for this revision Revisions of this file
diff -r 19e8022f60ea -r 6ac3cac5677c MX.cpp
--- a/MX.cpp	Wed Jul 13 15:53:34 2016 +0000
+++ b/MX.cpp	Thu Nov 24 15:29:50 2016 +0000
@@ -1,6 +1,6 @@
 #include "MX.h"
 
-#include <cmath>
+#include <math.h>
 
 #define MOVING_SPEED_UNIT_RPM 0.114
 
@@ -251,6 +251,10 @@
   this->maxSpeedDegreeS = maxSpeedDegreeS;
 }
 
+int min(int a, int b) {
+    if(a < b) return a; else return b;
+}
+
 void MX::setCRSpeed(float goalSpeedDegreeS) {
     // bit 10     = direction, 0 = CCW, 1=CW
     // bits 9-0   = Speed
@@ -258,7 +262,7 @@
 
     float rpm = std::abs(goalSpeedDegreeS * _gear_train) / 360 * 60;
     int goal = rpm / MOVING_SPEED_UNIT_RPM;
-    goal = fmin(goal, 0x3ff);
+    goal = min(goal, 0x3ff);
 
     // Set direction CW if we have a negative speed
     if (goalSpeedDegreeS < 0) {
diff -r 19e8022f60ea -r 6ac3cac5677c mbed-dev.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-dev.lib	Thu Nov 24 15:29:50 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/mbed_official/code/mbed-dev/#02e0a0aed4ec
diff -r 19e8022f60ea -r 6ac3cac5677c mbed-src.lib
--- a/mbed-src.lib	Wed Jul 13 15:53:34 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://developer.mbed.org/teams/Team-DIANA/code/mbed-src/#2405a6d45c2c