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
- Committer:
- antbig
- Date:
- 2016-04-15
- Revision:
- 2:8d8e2cf798a3
- Parent:
- 1:116040d14164
- Child:
- 3:19f2285a4757
File content as of revision 2:8d8e2cf798a3:
#include "StrategieManager.h" /****************************************************************************************/ /* FUNCTION NAME: doFunnyAction */ /* DESCRIPTION : Permet de faire la funny action en fin de partie */ /****************************************************************************************/ void doFunnyAction(void) { } /****************************************************************************************/ /* FUNCTION NAME: doAction */ /* DESCRIPTION : Effectuer une action specifique */ /****************************************************************************************/ unsigned char doAction(unsigned char id, unsigned short speed, short angle) { led1 = 1; led2 = 1; switch(id) { case 101://Descendre le bras pour les poissons if(InversStrat == 1) {//Si c'est inversé AX12_setGoal(1,200,0x0FF); AX12_processChange(); } else { } break; case 102://Remonter bras moiter if(InversStrat == 1) {//Si c'est inversé AX12_setGoal(1,270,0x0FF); AX12_processChange(); } else { } break; case 103://Lacher les poissons if(InversStrat == 1) {//Si c'est inversé AX12_setGoal(1,210,0x0FF); AX12_processChange(); wait_ms(500); AX12_setGoal(2,90);//Ouverture du bras AX12_processChange(); } else { } break; case 104://Rentrer le bras if(InversStrat == 1) {//Si c'est inversé AX12_setGoal(1,278,0x0FF); AX12_setGoal(2,160);//fermer le bras AX12_processChange(); } else { } break; default: return 0;//L'action n'existe pas, il faut utiliser le CAN } return 1;//L'action est spécifique. } /****************************************************************************************/ /* FUNCTION NAME: initRobot */ /* DESCRIPTION : initialiser le robot */ /****************************************************************************************/ void initRobot(void) { }