![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ok
Fork of _test_suivi_mur by
Diff: main.cpp
- Revision:
- 4:78a9354fcee8
- Parent:
- 3:b91371837109
- Child:
- 6:5f7df5c74a77
--- a/main.cpp Mon May 29 12:01:43 2017 +0000 +++ b/main.cpp Mon May 29 16:50:40 2017 +0000 @@ -7,7 +7,7 @@ int etat=0; init(); while(1) { - printf("etat=%d US1=%.0f US2=%.0f US3=%.0f erreur=%.0f AN1=%.0f AN2=%.0f cmdD=%.0f cmdG=%.0f\n\r",etat,US1,US2,US3,(US2-US1),AN1,AN2,cmdD,cmdG); + // printf("etat=%d US1=%.0f US2=%.0f US3=%.0f erreur=%.0f AN1=%.0f AN2=%.0f cmdD=%.0f cmdG=%.0f\n\r",etat,US1,US2,US3,(US2-US1),AN1,AN2,cmdD,cmdG); //wait(0.05); ledsetat.write(etat); switch(etat) { @@ -22,19 +22,24 @@ } break; case 1 : + if(US2>100 && US1<40) { + etat=2; + stopMotor(); + } if(AN2>30) { etat=0; t2.start(); t2.reset(); stopMotor(); } + break; case 2 : if((AN2>10 && AN2<20) || US3<13) { etat=1; stopMotor(); } - if(t2.read()>2) { + if(t2.read()>4) { etat=0; } break;