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.
Fork of Programme_course by
Revision 1:000a03402c6e, committed 2017-02-01
- Comitter:
- leandre
- Date:
- Wed Feb 01 13:41:24 2017 +0000
- Parent:
- 0:3ec7fc598e48
- Commit message:
- prog course avec menu am?lior?
Changed in this revision
diff -r 3ec7fc598e48 -r 000a03402c6e Mlib.h --- a/Mlib.h Thu Jan 26 07:37:45 2017 +0000 +++ b/Mlib.h Wed Feb 01 13:41:24 2017 +0000 @@ -23,7 +23,7 @@ #define CORRECTION_VIRAGE 1 #define MAX_BATTERY 1.3 #define SEUIL_NB_DERRIVEE 25 -#define KD 400 +#define KD 600 //valeur de base 400 #define KI 3 #define BOSSE_ACTIVE S2
diff -r 3ec7fc598e48 -r 000a03402c6e main.cpp --- a/main.cpp Thu Jan 26 07:37:45 2017 +0000 +++ b/main.cpp Wed Feb 01 13:41:24 2017 +0000 @@ -69,15 +69,7 @@ flag = 1; } -void arret() -{ - PWM_motor(MOTEUR_A, 0); - PWM_motor(MOTEUR_B, 0); - while(BP1); - while(!BP1); - while(BP1); - t_debut.reset(); -} + @@ -95,26 +87,44 @@ clk_active = 0;//L'horloge est désactivée t_clk.attach(&F_CLK, 1/(2.0*FRQ_CLK));//interruption horloge + + timer.start(); - angle_servo_moteur(0);//on met les roues droite pour commencer + angle_servo_moteur(0);//on met les roues droite pour commencer +} + +void arret() +{ + PWM_motor(MOTEUR_A, 0);//arret des moteurs + PWM_motor(MOTEUR_B, 0); + angle_servo_moteur(0);//roues droites //ici + while(BP1); + while(!BP1){ //ici + menu(); + } + while(BP1); + Init_car(); //permet de changer la vitesse avec le pot //ici + t_debut.reset(); } int main() { + Init_car(); - Init_car(); while(!BP1)//tant que l'on appuie pas sur BP1 { menu(); } while(BP1);//on attends le relachement de BP1 - + + /***************Début de la course***************/ t_debut.start();//Timer du début de la course t_ligne.start(); + /************************************************/ @@ -156,6 +166,8 @@ /****************Detection_arrivee*******************/ fin_course(); + + }
diff -r 3ec7fc598e48 -r 000a03402c6e shield.cpp --- a/shield.cpp Thu Jan 26 07:37:45 2017 +0000 +++ b/shield.cpp Wed Feb 01 13:41:24 2017 +0000 @@ -66,4 +66,5 @@ KP += ((pot2.read()+1)*100); } VIT /= 10; + pc.printf("VIT=%d\nKP=%d\n",VIT,KP); //ici }
diff -r 3ec7fc598e48 -r 000a03402c6e traitement_image.cpp --- a/traitement_image.cpp Thu Jan 26 07:37:45 2017 +0000 +++ b/traitement_image.cpp Wed Feb 01 13:41:24 2017 +0000 @@ -16,7 +16,7 @@ save_b = MARGE_LIGNE; save_a = MARGE_LIGNE; somme_derivee = 0; - for(i = 0; i < 62-4; i++) + for(i = 0; i < 62-4; i++) //analyse de la partie droite de la piste { tab[0] = cam_data[AMIDTAB+i]; tab[1] = cam_data[AMIDTAB+i+1]; @@ -33,7 +33,7 @@ mem_a = i; } } - for(i = 1; i < 63-4; i++) + for(i = 1; i < 63-4; i++) //analyse de la partie gauche de la piste { tab[0] = cam_data[AMIDTAB-i]; tab[1] = cam_data[AMIDTAB-i-1];