Index: branch/vilain_sebastien/Emb_App.tws
===================================================================
--- branch/vilain_sebastien/Emb_App.tws	(revision 77)
+++ branch/vilain_sebastien/Emb_App.tws	(revision 78)
@@ -13,9 +13,9 @@
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
-"E:\tp_info6_2018_vilain_sebastien\Emb_App\Debug\mr308.inc" -8 -30 1596 539 1 4 
+"E:\tp_info6_2018_vilain_sebastien\Emb_App\Debug\mr308.inc" 0 0 1596 539 0 4 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\conf_noyau.cfg" 50 50 1430 351 0 2 
-"E:\tp_info6_2018_vilain_sebastien\Emb_App\crt0mr.a30" 25 25 1430 351 0 1 
+"E:\tp_info6_2018_vilain_sebastien\Emb_App\crt0mr.a30" -8 -30 1596 539 1 1 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\programme_principal_etud.c" 0 0 1596 539 0 0 
 "E:\tp_info6_2018_vilain_sebastien\bsp\periph.c" 75 75 1430 351 0 3 
 [LOADED_PROJECTS]
Index: branch/vilain_sebastien/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/vilain_sebastien/Emb_App/SessionM32C_E8a_system.hsf	(revision 77)
+++ branch/vilain_sebastien/Emb_App/SessionM32C_E8a_system.hsf	(revision 78)
@@ -141,8 +141,8 @@
 "{55384715-F881-421C-A548-D7D1ABE158E1}PDMRWndInstanceKey0" "{WK_00000001_PDMR}EmbM32C87AppSessionM32C_E8a_system" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_DENORMAL_MODE" "0" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_ROUND_MODE" "0" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000004040" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000004044" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000020" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_10" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_11" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_12" "0000000000000000" 
@@ -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" "0000000000FF02AD" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF0574" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "00000000000009C4" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "00000000000007CC" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000004045" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000AE0" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000081A" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000044" 
 "{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" 
@@ -164,7 +164,7 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_27" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_28" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_29" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_3" "0000000000003000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_3" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_30" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_31" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_32" "0000000000000000" 
@@ -171,9 +171,9 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_33" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_34" "000000000000036A" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "000000000000000A" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "00000000000009E6" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000B16" 
 "{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" 
@@ -205,9 +205,11 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth2" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth3" "200" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH" "c,buff,n,rx,flag," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000" "erreur, 1, 0, P, Col, Dec, MN" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000" "erreur, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "1" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "dist, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "2" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -309,10 +311,10 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
-"E:\tp_info6_2018_vilain_sebastien\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\programme_principal_etud.c" 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\conf_noyau.cfg" 
+"E:\tp_info6_2018_vilain_sebastien\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_vilain_sebastien\bsp\periph.c" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
@@ -360,5 +362,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 77540176 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 89664616 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/vilain_sebastien/Emb_App/programme_principal_etud.c
===================================================================
--- branch/vilain_sebastien/Emb_App/programme_principal_etud.c	(revision 77)
+++ branch/vilain_sebastien/Emb_App/programme_principal_etud.c	(revision 78)
@@ -125,10 +125,11 @@
 short lecture_angle();
 short lecture_telemetre();
 void commande_vitesse(short vitesse);
+void choix_circuit(int i);
 short consigne_angle = 450;
 short erreur;
 short vitesse = 120;
-short consigne_telemetre = 750;
+short consigne_telemetre = 714;
 FLGPTN flag;
 short dist;
 
@@ -142,7 +143,7 @@
 
     can_init();
     clavier_init(1);
-	capture_init();
+	capture_init();
 	
 	periph[ADDR('R')].ev=0x01;
 	
@@ -151,11 +152,10 @@
 	sta_tsk(ID_asserv0);
 	sta_tsk(ID_asserv1);
 
-	commande_vitesse(40);
+	commande_vitesse(35);
 	
     while(1)
-    {
-		dist=lecture_telemetre();
+    {
 		LED_J=1;
 		dly_tsk(100);
 		LED_J=0;
@@ -228,9 +228,16 @@
 {
 	int K = 1;
 	short erreur;
+	short ancien_dist;
 	while(1)
 	{
-		erreur = K*(consigne_telemetre-lecture_telemetre());
+		ancien_dist = dist;
+		dist = lecture_telemetre();
+		if(dist >= 1000)
+		{
+			dist = ancien_dist;
+		}
+		erreur = K*(consigne_telemetre-dist);
 		commande_angle_roues(-erreur);
 		dly_tsk(98);
 	}
Index: branch/vilain_sebastien/Emb_App/EmbM32C87App.tps
===================================================================
--- branch/vilain_sebastien/Emb_App/EmbM32C87App.tps	(revision 77)
+++ branch/vilain_sebastien/Emb_App/EmbM32C87App.tps	(revision 78)
@@ -18,7 +18,7 @@
 "SessionM32C_E8a_system" 
 [GENERAL_DATA_PROJECT]
 [GENERAL_DATA_CONFIGURATION_Debug]
-"PROJECT_FILES_MODIFIED_DATA_TAG" "FALSE" 
+"PROJECT_FILES_MODIFIED_DATA_TAG" "TRUE" 
 [SESSIONS_Debug]
 "DefaultSession" 
 "SessionM32C_E8a_system" 
