marc le dep
Dependencies: BSP_DISCO_F429ZI LCD_DISCO_F429ZI TS_DISCO_F429ZI mbed
Revision 1:59fe933886bd, committed 2018-03-29
- Comitter:
- Alex_mln
- Date:
- Thu Mar 29 07:14:46 2018 +0000
- Parent:
- 0:4910cdb3d377
- Commit message:
- sghkjlm
Changed in this revision
automatique.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/automatique.cpp Thu Mar 29 06:19:39 2018 +0000 +++ b/automatique.cpp Thu Mar 29 07:14:46 2018 +0000 @@ -1,5 +1,6 @@ #include "automatique.h" #include "capteur.h" +#include "fonctions.h" LCD_DISCO_F429ZI lcd3; TS_DISCO_F429ZI ts3; @@ -7,7 +8,9 @@ uint16_t xa, ya; DigitalOut led1(PG_7); //lente gauche -DigitalOut led2(PB_4); //rapide + + +/* DigitalOut led2(PB_4); //rapide DigitalOut led3(PA_8); //lente droite DigitalOut led4(PA_14); //rapide @@ -44,11 +47,11 @@ void action(bool c1, bool c2, bool c3){ - /* led5=1; + led5=1; led1=0; led2=0; led3=0; - led4=0;*/ + led4=0; if(c1==false && c2==true && c3==false){ led5=0; //clignotement normal des deux LEDs lentes @@ -112,4 +115,27 @@ detectiona(); } - return(1);} \ No newline at end of file + return(1);}*/ + + +int go_automatique(int vit){ + for(int k=0;k<5;k++){ + led1=!led1; + wait(0.1);} + while(1){ + bool capt=code(2); + + if(capt==true){ + led1=1;} + else if(capt==false){ + led1=0;} + else{ + erreur();} + wait(0.1);} + + + + + + return(1); + } \ No newline at end of file