Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Servo AX12_final MX106_not_working comunication_1
Revision 12:6ac3cac5677c, committed 2016-11-24
- Comitter:
- clynamen
- Date:
- Thu Nov 24 15:29:50 2016 +0000
- Parent:
- 11:19e8022f60ea
- Child:
- 13:698bd4df9702
- Commit message:
- dynamixel
Changed in this revision
--- 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) {
--- /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
--- 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