PSL_2021 / servomotor_MX12_Lorenzo

Dependents:   PSL_ROBOT_lorenzo robot_lorenzo recepteur_mbed_os_6

Revision:
27:06850c65b9c8
Parent:
26:4632a02a8ef1
Child:
28:c7402e1014b4
--- a/MX12.cpp	Fri Nov 26 07:16:53 2021 +0000
+++ b/MX12.cpp	Fri Nov 26 08:55:31 2021 +0000
@@ -406,10 +406,25 @@
     printf("%d %d %dn\r",(int)(1000*W1),(int)(1000*W2),(int)(1000*W3));
   
     
-    SetSpeed(1,W1);  // impose la vitesse au moteur 1
-    SetSpeed(2,W2);
-    SetSpeed(3,W3);
+    SetSpeed_rad_s(1,W1);  // impose la vitesse au moteur 1
+    SetSpeed_rad_s(2,W2);
+    SetSpeed_rad_s(3,W3);
  
 
+   
+    }
+  
+void MX12::eteindre_moteurs(){
+     char data[1];
+
+    data[0] = 0;
+
     
-    }
+    // Send instruction
+    _bus_state = SerialState::Writing;
+    rw(1, CONTROL_TABLE_TORQUE_ENABLE , 1, data);
+    _bus_state = SerialState::Writing;
+    rw(2, CONTROL_TABLE_TORQUE_ENABLE , 1, data);
+    _bus_state = SerialState::Writing;
+    rw(3, CONTROL_TABLE_TORQUE_ENABLE , 1, data);
+}