![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
...
main.cpp
- Committer:
- vermaelen
- Date:
- 2017-05-28
- Revision:
- 2:82b72fa8dbcd
- Parent:
- 1:714fd6b732be
- Child:
- 3:b91371837109
File content as of revision 2:82b72fa8dbcd:
#include "mbed.h" #include "fct.h" int main() { int etat=0; init(); while(1) { //printf("etat=%d US1=%.0f US2=%.0f erreur=%.0f cmdD=%.0f cmdG=%.0f\n\r",etat,US1,US2,(US2-US1),cmdD,cmdG); //wait(0.05); switch(etat) { case 0 : if(AN2<20 || US3<13) { etat=1; stopMotor(); } break; case 1 : if(AN2>30) { etat=0; stopMotor(); } break; } switch(etat) { case 0 : suivi_mur(); break; case 1 : rotation_horaire(); break; } } }