code petit robot pour homologation
Fork of CRAC-Strat_2017_V2 by
peripheriques/peripheriques.h@16:7321fb3bb396, 2017-05-19 (annotated)
- Committer:
- ClementBreteau
- Date:
- Fri May 19 17:13:46 2017 +0000
- Revision:
- 16:7321fb3bb396
- Child:
- 18:cc5fec34ed9c
strat du robot, ann?e 2017, le 19 mai ? 19h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ClementBreteau | 16:7321fb3bb396 | 1 | #ifndef CRAC_PERIPHERIQUES |
ClementBreteau | 16:7321fb3bb396 | 2 | #define CRAC_PERIPHERIQUES |
ClementBreteau | 16:7321fb3bb396 | 3 | |
ClementBreteau | 16:7321fb3bb396 | 4 | #include "global.h" |
ClementBreteau | 16:7321fb3bb396 | 5 | |
ClementBreteau | 16:7321fb3bb396 | 6 | #define VITESSE 700 |
ClementBreteau | 16:7321fb3bb396 | 7 | |
ClementBreteau | 16:7321fb3bb396 | 8 | /* |
ClementBreteau | 16:7321fb3bb396 | 9 | DigitalIn IO1(p23); |
ClementBreteau | 16:7321fb3bb396 | 10 | DigitalIn IO2(p24); |
ClementBreteau | 16:7321fb3bb396 | 11 | DigitalIn IO3(p25); |
ClementBreteau | 16:7321fb3bb396 | 12 | DigitalIn IO4(p26); |
ClementBreteau | 16:7321fb3bb396 | 13 | |
ClementBreteau | 16:7321fb3bb396 | 14 | AnalogIn A_in1(p15); |
ClementBreteau | 16:7321fb3bb396 | 15 | AnalogIn A_in2(p16); |
ClementBreteau | 16:7321fb3bb396 | 16 | AnalogIn A_in3(p17); |
ClementBreteau | 16:7321fb3bb396 | 17 | AnalogIn A_in4(p18); |
ClementBreteau | 16:7321fb3bb396 | 18 | AnalogIn A_in5(p19); |
ClementBreteau | 16:7321fb3bb396 | 19 | AnalogIn A_in6(p20); |
ClementBreteau | 16:7321fb3bb396 | 20 | |
ClementBreteau | 16:7321fb3bb396 | 21 | PwmOut IRL_1(p21); |
ClementBreteau | 16:7321fb3bb396 | 22 | PwmOut IRL_2(p22); |
ClementBreteau | 16:7321fb3bb396 | 23 | */ |
ClementBreteau | 16:7321fb3bb396 | 24 | |
ClementBreteau | 16:7321fb3bb396 | 25 | #define TIME 1 |
ClementBreteau | 16:7321fb3bb396 | 26 | #define T_MOT 0.00005 |
ClementBreteau | 16:7321fb3bb396 | 27 | /*********************************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 28 | /* FUNCTION NAME: initAX12 */ |
ClementBreteau | 16:7321fb3bb396 | 29 | /* DESCRIPTION : initialise les AX12 */ |
ClementBreteau | 16:7321fb3bb396 | 30 | /*********************************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 31 | void initAX12(void); |
ClementBreteau | 16:7321fb3bb396 | 32 | |
ClementBreteau | 16:7321fb3bb396 | 33 | /*********************************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 34 | /* FUNCTION NAME: moteurGauchePWM */ |
ClementBreteau | 16:7321fb3bb396 | 35 | /* DESCRIPTION : bouge le moteur gauche */ |
ClementBreteau | 16:7321fb3bb396 | 36 | /*********************************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 37 | void moteurGauchePWM(float pwm); |
ClementBreteau | 16:7321fb3bb396 | 38 | |
ClementBreteau | 16:7321fb3bb396 | 39 | /*********************************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 40 | /* FUNCTION NAME: moteurDroitPWM */ |
ClementBreteau | 16:7321fb3bb396 | 41 | /* DESCRIPTION : bouge le moteur gauche */ |
ClementBreteau | 16:7321fb3bb396 | 42 | /*********************************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 43 | void moteurDroitPWM(float pwm); |
ClementBreteau | 16:7321fb3bb396 | 44 | |
ClementBreteau | 16:7321fb3bb396 | 45 | /*********************************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 46 | /* FUNCTION NAME: initMoteurs */ |
ClementBreteau | 16:7321fb3bb396 | 47 | /* DESCRIPTION : init les moteurs des mains du petit robot */ |
ClementBreteau | 16:7321fb3bb396 | 48 | /*********************************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 49 | void initMoteurs(void); |
ClementBreteau | 16:7321fb3bb396 | 50 | |
ClementBreteau | 16:7321fb3bb396 | 51 | /* PROTOTYPES DE FONCTIONS ET POINTEURS */ |
ClementBreteau | 16:7321fb3bb396 | 52 | |
ClementBreteau | 16:7321fb3bb396 | 53 | void declarationAX12(void); |
ClementBreteau | 16:7321fb3bb396 | 54 | |
ClementBreteau | 16:7321fb3bb396 | 55 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 56 | /* FUNCTION NAME: Initialisation_position */ |
ClementBreteau | 16:7321fb3bb396 | 57 | /* DESCRIPTION : Fonction qui place les bras en position verticale */ |
ClementBreteau | 16:7321fb3bb396 | 58 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 59 | void Initialisation_position(void); |
ClementBreteau | 16:7321fb3bb396 | 60 | |
ClementBreteau | 16:7321fb3bb396 | 61 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 62 | /* FUNCTION NAME: Preparation_prise */ |
ClementBreteau | 16:7321fb3bb396 | 63 | /* DESCRIPTION : Fonction qui prepare le robot pour prendre les modules */ |
ClementBreteau | 16:7321fb3bb396 | 64 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 65 | void Preparation_prise(void); |
ClementBreteau | 16:7321fb3bb396 | 66 | |
ClementBreteau | 16:7321fb3bb396 | 67 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 68 | /* FUNCTION NAME: Stockage_haut */ |
ClementBreteau | 16:7321fb3bb396 | 69 | /* DESCRIPTION : Fonction qui prend et stocke les modules dans la position haute */ |
ClementBreteau | 16:7321fb3bb396 | 70 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 71 | void Stockage_haut(void); |
ClementBreteau | 16:7321fb3bb396 | 72 | |
ClementBreteau | 16:7321fb3bb396 | 73 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 74 | /* FUNCTION NAME: Stockage_bas */ |
ClementBreteau | 16:7321fb3bb396 | 75 | /* DESCRIPTION : Fonction qui prend et stocke un module dans la pince */ |
ClementBreteau | 16:7321fb3bb396 | 76 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 77 | void Stockage_bas(void); |
ClementBreteau | 16:7321fb3bb396 | 78 | |
ClementBreteau | 16:7321fb3bb396 | 79 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 80 | /* FUNCTION NAME: Deposer */ |
ClementBreteau | 16:7321fb3bb396 | 81 | /* DESCRIPTION : Fonction qui permet de déposer un module */ |
ClementBreteau | 16:7321fb3bb396 | 82 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 83 | void Deposer(void); |
ClementBreteau | 16:7321fb3bb396 | 84 | |
ClementBreteau | 16:7321fb3bb396 | 85 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 86 | /* FUNCTION NAME: Preparation_depos_bas */ |
ClementBreteau | 16:7321fb3bb396 | 87 | /* DESCRIPTION : Fonction qui prépare le depos d'un module en bas */ |
ClementBreteau | 16:7321fb3bb396 | 88 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 89 | void Preparation_depot_bas(void); |
ClementBreteau | 16:7321fb3bb396 | 90 | |
ClementBreteau | 16:7321fb3bb396 | 91 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 92 | /* FUNCTION NAME: Preparation_depos_haut */ |
ClementBreteau | 16:7321fb3bb396 | 93 | /* DESCRIPTION : Fonction qui prépare le depos d'un module en haut */ |
ClementBreteau | 16:7321fb3bb396 | 94 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 95 | void Preparation_depot_haut(void); |
ClementBreteau | 16:7321fb3bb396 | 96 | |
ClementBreteau | 16:7321fb3bb396 | 97 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 98 | /* FUNCTION NAME: Pousser_module */ |
ClementBreteau | 16:7321fb3bb396 | 99 | /* DESCRIPTION : Fonction qui permet pousser le module situé à l'entrée de la bas */ |
ClementBreteau | 16:7321fb3bb396 | 100 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 101 | void Pousser_module(void); |
ClementBreteau | 16:7321fb3bb396 | 102 | |
ClementBreteau | 16:7321fb3bb396 | 103 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 104 | /* FUNCTION NAME: Initialisation_gauche */ |
ClementBreteau | 16:7321fb3bb396 | 105 | /* DESCRIPTION : Fonction qui permet de placer le cote gauche en position initiale */ |
ClementBreteau | 16:7321fb3bb396 | 106 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 107 | void Initialisation_gauche(void); |
ClementBreteau | 16:7321fb3bb396 | 108 | |
ClementBreteau | 16:7321fb3bb396 | 109 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 110 | /* FUNCTION NAME: Preparation_prise_gauche */ |
ClementBreteau | 16:7321fb3bb396 | 111 | /* DESCRIPTION : Fonction qui permet prendre un module sur le cote gauche */ |
ClementBreteau | 16:7321fb3bb396 | 112 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 113 | void Preparation_prise_gauche(void); |
ClementBreteau | 16:7321fb3bb396 | 114 | |
ClementBreteau | 16:7321fb3bb396 | 115 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 116 | /* FUNCTION NAME: Prendre_module_gauche */ |
ClementBreteau | 16:7321fb3bb396 | 117 | /* DESCRIPTION : Fonction qui permet prendre un module sur le cote gauche */ |
ClementBreteau | 16:7321fb3bb396 | 118 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 119 | void Prendre_module_gauche(void); |
ClementBreteau | 16:7321fb3bb396 | 120 | |
ClementBreteau | 16:7321fb3bb396 | 121 | /***************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 122 | /* FUNCTION NAME: RangerBrasGauche */ |
ClementBreteau | 16:7321fb3bb396 | 123 | /* DESCRIPTION : Fonction range le bras gauche */ |
ClementBreteau | 16:7321fb3bb396 | 124 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 125 | void RangerBrasGauche(void); |
ClementBreteau | 16:7321fb3bb396 | 126 | |
ClementBreteau | 16:7321fb3bb396 | 127 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 128 | /* FUNCTION NAME: Tourner_module_gauche */ |
ClementBreteau | 16:7321fb3bb396 | 129 | /* DESCRIPTION : Fonction qui permet de tourner les modules a gauche */ |
ClementBreteau | 16:7321fb3bb396 | 130 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 131 | void Tourner_module_gauche(void); |
ClementBreteau | 16:7321fb3bb396 | 132 | |
ClementBreteau | 16:7321fb3bb396 | 133 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 134 | /* FUNCTION NAME: Preparatio_module_gauche */ |
ClementBreteau | 16:7321fb3bb396 | 135 | /* DESCRIPTION : Fonction qui prepare le tournante */ |
ClementBreteau | 16:7321fb3bb396 | 136 | /****************************************************************************************/ |
ClementBreteau | 16:7321fb3bb396 | 137 | void Preparation_module_gauche(void); |
ClementBreteau | 16:7321fb3bb396 | 138 | |
ClementBreteau | 16:7321fb3bb396 | 139 | void getPosiotionCentrale(void); |
ClementBreteau | 16:7321fb3bb396 | 140 | void getPosiotionGauche(void); |
ClementBreteau | 16:7321fb3bb396 | 141 | void getPosiotionDroite(void); |
ClementBreteau | 16:7321fb3bb396 | 142 | |
ClementBreteau | 16:7321fb3bb396 | 143 | |
ClementBreteau | 16:7321fb3bb396 | 144 | |
ClementBreteau | 16:7321fb3bb396 | 145 | |
ClementBreteau | 16:7321fb3bb396 | 146 | |
ClementBreteau | 16:7321fb3bb396 | 147 | |
ClementBreteau | 16:7321fb3bb396 | 148 | bool dataCouleurGauche(void); |
ClementBreteau | 16:7321fb3bb396 | 149 | bool dataCouleurDroit(void); |
ClementBreteau | 16:7321fb3bb396 | 150 | short dataTelemetre(void); |
ClementBreteau | 16:7321fb3bb396 | 151 | bool dataPressionGauche(void); |
ClementBreteau | 16:7321fb3bb396 | 152 | bool dataPressionDroit(void); |
ClementBreteau | 16:7321fb3bb396 | 153 | |
ClementBreteau | 16:7321fb3bb396 | 154 | #endif |