FRC_equipe1 / Mbed 2 deprecated FRC_2019

Dependencies:   mbed

Committer:
Wael_H
Date:
Mon May 20 14:58:09 2019 +0000
Revision:
7:753e901d441b
Parent:
6:a24e1ffe27f6
Child:
8:94ecfe411d02
Premier automate de Wael et Theo :)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wael_H 2:8971078b1ccf 1 #include "mbed.h"
Wael_H 5:34048faec367 2 #include "CAN_asser.h"
Wael_H 2:8971078b1ccf 3
Wael_H 2:8971078b1ccf 4 int main(void)
Wael_H 2:8971078b1ccf 5 {
Wael_H 7:753e901d441b 6 bool quit = false;
Wael_H 7:753e901d441b 7
Wael_H 7:753e901d441b 8 can_init();
Wael_H 7:753e901d441b 9
Wael_H 7:753e901d441b 10 while(!quit)
Wael_H 7:753e901d441b 11 {
Wael_H 7:753e901d441b 12 trait_can();
Wael_H 7:753e901d441b 13 }
Wael_H 2:8971078b1ccf 14
Wael_H 2:8971078b1ccf 15 return 0;
Wael_H 7:753e901d441b 16 }
Wael_H 7:753e901d441b 17
Wael_H 7:753e901d441b 18 void automate_test()
Wael_H 7:753e901d441b 19 {
Wael_H 7:753e901d441b 20 static typedef enum{AVANCE,TOURNE} type_etat;
Wael_H 7:753e901d441b 21 type_etat etat = AVANCE;
Wael_H 7:753e901d441b 22
Wael_H 7:753e901d441b 23 switch(etat)
Wael_H 7:753e901d441b 24 {
Wael_H 7:753e901d441b 25 case AVANCE:
Wael_H 7:753e901d441b 26 Gostraight(500,0,0,0);
Wael_H 7:753e901d441b 27
Wael_H 7:753e901d441b 28 if(FlagFinDpl)
Wael_H 7:753e901d441b 29 etat = TOURNE;
Wael_H 7:753e901d441b 30 break;
Wael_H 7:753e901d441b 31
Wael_H 7:753e901d441b 32 case TOURNE:
Wael_H 7:753e901d441b 33 Rotate(900);
Wael_H 7:753e901d441b 34
Wael_H 7:753e901d441b 35 if(FlagFinDpl)
Wael_H 7:753e901d441b 36 etat = AVANCE;
Wael_H 7:753e901d441b 37 break;
Wael_H 7:753e901d441b 38 }
Wael_H 2:8971078b1ccf 39 }