Robot secondaire

Dependencies:   RoboClaw mbed StepperMotor

Fork of RoboClaw by Simon Emarre

Revision:
71:5590dbe8393a
Parent:
51:1056dd73a748
--- a/AX12/AX12.cpp	Wed May 04 21:51:00 2016 +0000
+++ b/AX12/AX12.cpp	Thu May 05 03:47:05 2016 +0000
@@ -98,6 +98,19 @@
     return(rVal);
 }
 
+int AX12::setSpeed(int speed)
+{
+    char data[2];
+    
+    data[0] = speed & 0xFF;
+    data[1] = speed >> 8;
+    
+    // write the packet, return the error code
+    int rVal = write(_ID, 0x20, 2, data);
+
+    return(rVal);
+}
+
 
 // set continuous rotation speed from -1 to 1
 int AX12::setCRSpeed(float speed) {