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.
Dependencies: mbed
main.cpp@10:efa507ba2b35, 2019-05-23 (annotated)
- Committer:
- Wael_H
- Date:
- Thu May 23 21:26:08 2019 +0000
- Revision:
- 10:efa507ba2b35
- Parent:
- 9:2113adf37c66
- Child:
- 11:e8c4a1c6553d
- Child:
- 13:9c62e263f245
Version avec classes a tester
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wael_H | 2:8971078b1ccf | 1 | #include "mbed.h" |
Wael_H | 5:34048faec367 | 2 | #include "CAN_asser.h" |
Wael_H | 10:efa507ba2b35 | 3 | #include "Robot.h" |
Wael_H | 10:efa507ba2b35 | 4 | |
Wael_H | 10:efa507ba2b35 | 5 | /*//Bonus fin de partie |
Wael_H | 10:efa507ba2b35 | 6 | PwmOut bonus(PA_10); |
Wael_H | 8:94ecfe411d02 | 7 | |
Wael_H | 10:efa507ba2b35 | 8 | //Disquette |
Wael_H | 10:efa507ba2b35 | 9 | PwmOut Servo_Ballon(PB_7); |
Wael_H | 10:efa507ba2b35 | 10 | PwmOut Mot_Ballon(PB_6);*/ |
Wael_H | 10:efa507ba2b35 | 11 | |
Wael_H | 10:efa507ba2b35 | 12 | |
Wael_H | 10:efa507ba2b35 | 13 | void automate_test(Robot& R); |
Wael_H | 10:efa507ba2b35 | 14 | |
Wael_H | 8:94ecfe411d02 | 15 | |
Wael_H | 2:8971078b1ccf | 16 | int main(void) |
Wael_H | 2:8971078b1ccf | 17 | { |
Wael_H | 10:efa507ba2b35 | 18 | Robot robot; |
Wael_H | 7:753e901d441b | 19 | |
Wael_H | 9:2113adf37c66 | 20 | while(1) |
Wael_H | 9:2113adf37c66 | 21 | automate_test(robot); |
Wael_H | 7:753e901d441b | 22 | } |
Wael_H | 7:753e901d441b | 23 | |
Wael_H | 10:efa507ba2b35 | 24 | |
Wael_H | 10:efa507ba2b35 | 25 | void automate_test(Robot& R) |
Wael_H | 7:753e901d441b | 26 | { |
Wael_H | 9:2113adf37c66 | 27 | typedef enum {AVANCE, TOURNE} type_etat; |
Wael_H | 8:94ecfe411d02 | 28 | static type_etat etat = AVANCE; |
Wael_H | 7:753e901d441b | 29 | |
Wael_H | 7:753e901d441b | 30 | switch(etat) |
Wael_H | 9:2113adf37c66 | 31 | { |
Wael_H | 8:94ecfe411d02 | 32 | case AVANCE: |
Wael_H | 9:2113adf37c66 | 33 | if(R.avance(500)) |
Wael_H | 8:94ecfe411d02 | 34 | etat = TOURNE; |
Wael_H | 8:94ecfe411d02 | 35 | break; |
Wael_H | 8:94ecfe411d02 | 36 | |
Wael_H | 8:94ecfe411d02 | 37 | case TOURNE: |
Wael_H | 9:2113adf37c66 | 38 | if(R.tourne(900)) |
Wael_H | 8:94ecfe411d02 | 39 | etat = AVANCE; |
Wael_H | 8:94ecfe411d02 | 40 | break; |
Wael_H | 7:753e901d441b | 41 | } |
Wael_H | 2:8971078b1ccf | 42 | } |