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.
Revision 2:eb529b2bf093, committed 2021-10-29
- Comitter:
 - mdalal
 - Date:
 - Fri Oct 29 10:48:51 2021 +0000
 - Parent:
 - 1:a0502fd47e2a
 - Commit message:
 - ;
 
Changed in this revision
| moteur.cpp | Show annotated file Show diff for this revision Revisions of this file | 
--- a/moteur.cpp	Fri Oct 29 06:56:54 2021 +0000
+++ b/moteur.cpp	Fri Oct 29 10:48:51 2021 +0000
@@ -1,6 +1,7 @@
 #include "MX12.h"
 //extern UnbufferedSerial pc_serie(USBTX,USBRX,115200);
 MX12 servo(PC_4,PC_5,115200);
+const 
 
 void cmd_moteur(float Vtm_s, float Vnm_s, float Wcrd_s){
     float coeff=578.7/1023;
@@ -32,9 +33,9 @@
     //if (Wcrd_s<-Wcrd_smax)
       //  {Wcrd_s=-Wcrd_smax;}
  
-    W1=(Wcrd_s*Rc-0.5*Vnm_s+0.866*Vtm_s)*coeff; //loi de commande moteur 1
-    W2=(Wcrd_s*Rc-0.5*Vnm_s-0.866*Vtm_s)*coeff;
-    W3=(Wcrd_s*Rc+Vnm_s)*coeff;
+    W2=(Wcrd_s*Rc-0.5*Vnm_s+0.866*Vtm_s)*coeff; //loi de commande moteur 1
+    W3=(Wcrd_s*Rc-0.5*Vnm_s-0.866*Vtm_s)*coeff;
+    W1=(Wcrd_s*Rc+Vnm_s)*coeff;
     printf("%d %d %dn\r",(int)(1000*W1),(int)(1000*W2),(int)(1000*W3));