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.
Fork of CRAC-Strat_2017_homologation_petit_rob by
Robots/Strategie_big.cpp@1:116040d14164, 2016-04-15 (annotated)
- Committer:
- antbig
- Date:
- Fri Apr 15 10:49:40 2016 +0000
- Revision:
- 1:116040d14164
- Parent:
- 0:ad97421fb1fb
- Child:
- 2:8d8e2cf798a3
Premier test fonctionnel avec le petit robot,
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
antbig | 1:116040d14164 | 1 | #include "StrategieManager.h" |
antbig | 0:ad97421fb1fb | 2 | |
antbig | 0:ad97421fb1fb | 3 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 4 | /* FUNCTION NAME: doFunnyAction */ |
antbig | 0:ad97421fb1fb | 5 | /* DESCRIPTION : Permet de faire la funny action en fin de partie */ |
antbig | 0:ad97421fb1fb | 6 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 7 | void doFunnyAction(void) { |
antbig | 0:ad97421fb1fb | 8 | |
antbig | 0:ad97421fb1fb | 9 | |
antbig | 0:ad97421fb1fb | 10 | } |
antbig | 0:ad97421fb1fb | 11 | |
antbig | 0:ad97421fb1fb | 12 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 13 | /* FUNCTION NAME: doAction */ |
antbig | 0:ad97421fb1fb | 14 | /* DESCRIPTION : Effectuer une action specifique */ |
antbig | 0:ad97421fb1fb | 15 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 16 | unsigned char doAction(unsigned char id, unsigned short speed, short angle) { |
antbig | 0:ad97421fb1fb | 17 | |
antbig | 1:116040d14164 | 18 | led1 = 1; |
antbig | 1:116040d14164 | 19 | led2 = 1; |
antbig | 0:ad97421fb1fb | 20 | switch(id) { |
antbig | 1:116040d14164 | 21 | case 101://Descendre le bras pour les poissons |
antbig | 1:116040d14164 | 22 | AX12_setGoal(1,190,0x0FF); |
antbig | 1:116040d14164 | 23 | AX12_processChange(); |
antbig | 1:116040d14164 | 24 | break; |
antbig | 1:116040d14164 | 25 | case 102://Remonter bras moiter |
antbig | 1:116040d14164 | 26 | AX12_setGoal(1,260,0x0FF); |
antbig | 1:116040d14164 | 27 | AX12_processChange(); |
antbig | 1:116040d14164 | 28 | break; |
antbig | 1:116040d14164 | 29 | case 103://Lacher les poissons |
antbig | 1:116040d14164 | 30 | AX12_setGoal(1,230,0x0FF); |
antbig | 1:116040d14164 | 31 | AX12_setGoal(2,60);//Ouverture du bras |
antbig | 1:116040d14164 | 32 | AX12_processChange(); |
antbig | 1:116040d14164 | 33 | break; |
antbig | 1:116040d14164 | 34 | case 104://Rentrer le bras |
antbig | 1:116040d14164 | 35 | AX12_setGoal(1,280,0x0FF); |
antbig | 1:116040d14164 | 36 | AX12_setGoal(2,160);//fermer le bras |
antbig | 1:116040d14164 | 37 | AX12_processChange(); |
antbig | 0:ad97421fb1fb | 38 | break; |
antbig | 0:ad97421fb1fb | 39 | default: |
antbig | 0:ad97421fb1fb | 40 | return 0;//L'action n'existe pas, il faut utiliser le CAN |
antbig | 0:ad97421fb1fb | 41 | |
antbig | 0:ad97421fb1fb | 42 | } |
antbig | 0:ad97421fb1fb | 43 | return 1;//L'action est spécifique. |
antbig | 0:ad97421fb1fb | 44 | |
antbig | 0:ad97421fb1fb | 45 | } |
antbig | 0:ad97421fb1fb | 46 | |
antbig | 0:ad97421fb1fb | 47 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 48 | /* FUNCTION NAME: initRobot */ |
antbig | 0:ad97421fb1fb | 49 | /* DESCRIPTION : initialiser le robot */ |
antbig | 0:ad97421fb1fb | 50 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 51 | void initRobot(void) { |
antbig | 0:ad97421fb1fb | 52 | |
antbig | 0:ad97421fb1fb | 53 | } |