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-27
- Revision:
- 8:0edc7dfb7f7e
- Parent:
- 7:dcce34c7e06e
- Child:
- 9:d0042422d95a
File content as of revision 8:0edc7dfb7f7e:
#include "StrategieManager.h" #ifdef ROBOT_BIG #include "Config_big.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) { switch(id) { case 101: break; case 110://Ouvrir la pince arrière haute AX12_setGoal(AX12_ID_PINCE_ARRIERE_HAUTE_GAUCHE, 205); AX12_setGoal(AX12_ID_PINCE_ARRIERE_HAUTE_DROITE, 95); AX12_processChange(); break; case 111://Fermer la pince arrière haute AX12_setGoal(AX12_ID_PINCE_ARRIERE_HAUTE_GAUCHE, 145); AX12_setGoal(AX12_ID_PINCE_ARRIERE_HAUTE_DROITE, 155); AX12_processChange(); break; case 112://Ouvrir la pince arrière basse break; case 113://Fermer la pince arrière basse break; case 114://Ouvrir les portes arrières AX12_setGoal(AX12_ID_PORTE_ARRIERE_GAUCHE, 250); AX12_setGoal(AX12_ID_PORTE_ARRIERE_DROITE, 50); AX12_processChange(); break; case 115://Fermer les portes arrière AX12_setGoal(AX12_ID_PORTE_ARRIERE_GAUCHE, 145); AX12_setGoal(AX12_ID_PORTE_ARRIERE_DROITE, 155); AX12_processChange(); 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) { AX12_register(4, AX12_SERIAL1); AX12_register(14, AX12_SERIAL1); AX12_register(15, AX12_SERIAL1); AX12_register(5, AX12_SERIAL2); AX12_register(18, AX12_SERIAL2); AX12_register(13, AX12_SERIAL2); } /****************************************************************************************/ /* FUNCTION NAME: SelectStrategy */ /* DESCRIPTION : Charger le fichier de stratégie correspondante à un id */ /* RETURN : 0=> Erreur, 1=> OK si le fichier existe */ /****************************************************************************************/ int SelectStrategy(unsigned char id) { switch(id) { case 1: break; } return 0; } #endif