Index: branch/noisette/Emb_App.tws
===================================================================
--- branch/noisette/Emb_App.tws	(revision 215)
+++ branch/noisette/Emb_App.tws	(revision 216)
@@ -15,8 +15,8 @@
 "E:\tp_info6_2018_noisette\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_noisette\tp_info6\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
-"E:\tp_info6_2018_noisette\tp_info6\Emb_App\crt0mr.a30" 0 0 956 523 0 1 
-"E:\tp_info6_2018_noisette\tp_info6\Emb_App\programme_principal_etud.c" -8 -30 956 523 1 0 
+"E:\tp_info6_2018_noisette\tp_info6\Emb_App\crt0mr.a30" -8 -30 956 523 1 1 
+"E:\tp_info6_2018_noisette\tp_info6\Emb_App\programme_principal_etud.c" 0 0 956 523 0 0 
 "E:\tp_info6_2018_noisette\tp_info6\bsp\can.c" 0 0 956 523 0 2 
 "E:\tp_info6_2018_noisette\tp_info6\bsp\clavier.c" 100 100 790 335 0 4 
 "E:\tp_info6_2018_noisette\tp_info6\bsp\dma0.c" 125 125 790 335 0 5 
Index: branch/noisette/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/noisette/Emb_App/SessionM32C_E8a_system.hsf	(revision 215)
+++ branch/noisette/Emb_App/SessionM32C_E8a_system.hsf	(revision 216)
@@ -149,12 +149,12 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_13" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_14" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_15" "0000000000000512" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF056C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF0578" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "00000000000009C8" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "00000000000007F2" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "00000000000009CC" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "00000000000007F6" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000004044" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000040" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_21" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_22" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_23" "0000000000000000" 
@@ -173,7 +173,7 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000008" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "00000000000009EE" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "00000000000009F2" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000512" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_8" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_9" "0000000000000000" 
@@ -311,8 +311,8 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"E:\tp_info6_2018_noisette\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_noisette\tp_info6\Emb_App\programme_principal_etud.c" 
-"E:\tp_info6_2018_noisette\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_noisette\tp_info6\bsp\dma0.c" 
 "E:\tp_info6_2018_noisette\tp_info6\bsp\clavier.c" 
 "E:\tp_info6_2018_noisette\tp_info6\bsp\periph.c" 
@@ -364,5 +364,5 @@
 [FLASH_DETAILS]
 "" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
 [BREAKPOINTS]
-"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 87560728 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 100602392 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/noisette/Emb_App/programme_principal_etud.c
===================================================================
--- branch/noisette/Emb_App/programme_principal_etud.c	(revision 215)
+++ branch/noisette/Emb_App/programme_principal_etud.c	(revision 216)
@@ -121,8 +121,10 @@
 //				correspondant au nom du véhicule si le nom se termine par '*'
 unsigned short alpha;
 int consigne_tourelle;
+int consigne_distance;
 unsigned short k;
 int erreur_tourelle;
+int erreur_distance;
 int vitesse;
 int distance_tourelle;
 UINT flag;
@@ -175,9 +177,9 @@
 		
 		req.data.id='U';
 		req.data.rtr=1;
-		periph[ADDR('U')].ev=0x02;
+		periph[ADDR('U')].ev=0x01;
 		snd_dtq(CanTx,req.msg);
-		wai_flg(ev_periph,0x02, TWF_ANDW, &flag);
+		wai_flg(ev_periph,0x01, TWF_ANDW, &flag);
 		distance_tourelle=periph[ADDR('U')].val;
 		
 		dly_tsk(10);
@@ -193,13 +195,19 @@
 		comm.data.rtr=0;
 		comm.data.val=asserv_tourelle(450);
 		snd_dtq(CanTx, comm.msg);
+		dly_tsk(50);
+		
+		comm.data.id= 'V';
+		comm.data.rtr=0;
+		comm.data.val=10;
+		snd_dtq(CanTx, comm.msg);
 		dly_tsk(10);
 		
-/*		comm.data.id= 'V';
+		comm.data.id= 'D';
 		comm.data.rtr=0;
-		comm.data.val=asserv_vitesse(40);
+		comm.data.val=-asserv_virage(719);
 		snd_dtq(CanTx, comm.msg);
-		dly_tsk(10);*/
+		dly_tsk(10);
 		
 		
     }
@@ -218,10 +226,15 @@
 		return consigne_tourelle;
 }
 
-int asserv_vitesse(vitesse) {
+
+int asserv_virage(consigne_distance) {
+		if (alpha==450) 
 		k = 3;
-		vitesse = distance_tourelle/vitesse;
-		return vitesse;
+		erreur_distance = consigne_distance - distance_tourelle;
+		consigne_distance = k*erreur_distance;
+		consigne_distance = consigne_distance/10;
+		
+		return consigne_distance;
 }
 
 
Index: branch/noisette/Emb_App/EmbM32C87App.tps
===================================================================
--- branch/noisette/Emb_App/EmbM32C87App.tps	(revision 215)
+++ branch/noisette/Emb_App/EmbM32C87App.tps	(revision 216)
@@ -18,7 +18,7 @@
 "SessionM32C_E8a_system" 
 [GENERAL_DATA_PROJECT]
 [GENERAL_DATA_CONFIGURATION_Debug]
-"PROJECT_FILES_MODIFIED_DATA_TAG" "TRUE" 
+"PROJECT_FILES_MODIFIED_DATA_TAG" "FALSE" 
 [SESSIONS_Debug]
 "DefaultSession" 
 "SessionM32C_E8a_system" 
