![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
carte esclave Petit Robot
Dependencies: mbed Herkulex_Library_2019 actions_Gr ident_crac actions_Pr
main.cpp@44:381ecf63e6ab, 2019-05-26 (annotated)
- Committer:
- Artiom
- Date:
- Sun May 26 10:51:35 2019 +0000
- Revision:
- 44:381ecf63e6ab
- Parent:
- 43:7fff7f4d79a1
- Child:
- 45:3cb347342a0d
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kyxstark | 25:9627700d989f | 1 | |
Artiom | 1:568955af8c2b | 2 | #include "main.h" |
Artiom | 0:bc74da1c502f | 3 | |
Artiom | 0:bc74da1c502f | 4 | #define SIZE_FIFO 50 |
Artiom | 0:bc74da1c502f | 5 | |
Artiom | 30:d034f469359e | 6 | |
Artiom | 0:bc74da1c502f | 7 | CAN can(PB_8,PB_9,1000000); // Rx&Tx pour le CAN |
Artiom | 0:bc74da1c502f | 8 | |
kyxstark | 22:9e92a2b941ba | 9 | Serial pc(USBTX,USBRX); |
Artiom | 0:bc74da1c502f | 10 | |
Artiom | 0:bc74da1c502f | 11 | CANMessage msgRxBuffer[SIZE_FIFO]; |
Artiom | 0:bc74da1c502f | 12 | unsigned char FIFO_ecriture=0; //Position du fifo pour la reception CAN |
Artiom | 0:bc74da1c502f | 13 | signed char FIFO_lecture=0;//Position du fifo de lecture des messages CAN |
Artiom | 0:bc74da1c502f | 14 | unsigned char EtatGameEnd=0; |
Artiom | 0:bc74da1c502f | 15 | |
marwanesaich | 42:a7300d563596 | 16 | char cote=0; |
Artiom | 32:e9947815c4d7 | 17 | |
Artiom | 44:381ecf63e6ab | 18 | unsigned short distance_recalage,distance_revenir; |
Artiom | 44:381ecf63e6ab | 19 | unsigned short distance_goldenium; |
Artiom | 32:e9947815c4d7 | 20 | |
kyxstark | 21:edf6d03fdb20 | 21 | void canProcessRx(void); |
Artiom | 12:191486ba5118 | 22 | |
Artiom | 12:191486ba5118 | 23 | |
Artiom | 0:bc74da1c502f | 24 | /*********************************************************************************************/ |
Artiom | 0:bc74da1c502f | 25 | /* FUNCTION NAME: canRx_ISR */ |
Artiom | 0:bc74da1c502f | 26 | /* DESCRIPTION : lit les messages sur le can et les stocke dans la FIFO */ |
Artiom | 0:bc74da1c502f | 27 | /*********************************************************************************************/ |
Artiom | 0:bc74da1c502f | 28 | void canRx_ISR (void) |
Artiom | 0:bc74da1c502f | 29 | { |
Artiom | 0:bc74da1c502f | 30 | if (can.read(msgRxBuffer[FIFO_ecriture])) { |
Artiom | 0:bc74da1c502f | 31 | if (msgRxBuffer[FIFO_ecriture].id==GLOBAL_GAME_END) { |
Artiom | 0:bc74da1c502f | 32 | |
Artiom | 0:bc74da1c502f | 33 | } |
Artiom | 0:bc74da1c502f | 34 | FIFO_ecriture=(FIFO_ecriture+1)%SIZE_FIFO; |
Artiom | 0:bc74da1c502f | 35 | |
Artiom | 0:bc74da1c502f | 36 | } |
Artiom | 0:bc74da1c502f | 37 | |
Artiom | 0:bc74da1c502f | 38 | } |
Artiom | 0:bc74da1c502f | 39 | |
Artiom | 0:bc74da1c502f | 40 | int main() |
Artiom | 0:bc74da1c502f | 41 | { |
Artiom | 0:bc74da1c502f | 42 | can.attach(&canRx_ISR); // création de l'interrupt attachée à la réception sur le CAN |
Artiom | 0:bc74da1c502f | 43 | servo_interrupt_en(); //permettre les interuptions |
Artiom | 11:6c11c081c855 | 44 | |
Artiom | 0:bc74da1c502f | 45 | wait(1);//attente servo boot |
Artiom | 31:29500874c1cc | 46 | |
Artiom | 31:29500874c1cc | 47 | |
kyxstark | 21:edf6d03fdb20 | 48 | #ifdef ROBOT_SMALL |
kyxstark | 22:9e92a2b941ba | 49 | pc.printf("\nPetit robot\n\n"); |
Artiom | 32:e9947815c4d7 | 50 | deverouillage_torque(); |
kyxstark | 21:edf6d03fdb20 | 51 | #endif |
kyxstark | 21:edf6d03fdb20 | 52 | |
kyxstark | 21:edf6d03fdb20 | 53 | |
Artiom | 31:29500874c1cc | 54 | |
kyxstark | 21:edf6d03fdb20 | 55 | #ifdef ROBOT_BIG |
kyxstark | 22:9e92a2b941ba | 56 | pc.printf("\nGros robot\n\n"); |
kyxstark | 38:9295a9721acb | 57 | deverouillage_torque(); |
marwanesaich | 41:a71d06f292ac | 58 | wait(0.5); |
kyxstark | 21:edf6d03fdb20 | 59 | #endif |
kyxstark | 21:edf6d03fdb20 | 60 | |
kyxstark | 38:9295a9721acb | 61 | gabarit_robot(); |
kyxstark | 38:9295a9721acb | 62 | |
kyxstark | 21:edf6d03fdb20 | 63 | |
kyxstark | 22:9e92a2b941ba | 64 | pc.printf("\nLAUNCHED"); |
Artiom | 0:bc74da1c502f | 65 | while(1) { |
marwanesaich | 42:a7300d563596 | 66 | /*setTorque(doigt,TORQUE_FREE,2); |
marwanesaich | 42:a7300d563596 | 67 | pc.printf("pos : %d\n", getPos(doigt,2)); |
marwanesaich | 42:a7300d563596 | 68 | wait_ms(10.0);*/ |
Artiom | 0:bc74da1c502f | 69 | canProcessRx(); |
Artiom | 10:48c0d1b8aed9 | 70 | f_mesure();//dt35 |
Artiom | 11:6c11c081c855 | 71 | |
kyxstark | 21:edf6d03fdb20 | 72 | |
kyxstark | 21:edf6d03fdb20 | 73 | #ifdef ROBOT_SMALL |
Artiom | 5:6e198cdd99ad | 74 | automate_ventouse_presentoir_arriere(); |
kyxstark | 24:33c7ff467bd9 | 75 | automate_ventouse_presentoir_avant(); |
Artiom | 7:553f3f1c2c53 | 76 | |
Artiom | 6:45f9cf44718a | 77 | automate_ventouse_goldenium_arriere(); |
kyxstark | 24:33c7ff467bd9 | 78 | automate_ventouse_goldenium_avant(); |
Artiom | 31:29500874c1cc | 79 | |
Artiom | 6:45f9cf44718a | 80 | automate_ventouse_sol_avant(); |
Artiom | 7:553f3f1c2c53 | 81 | automate_ventouse_sol_arriere(); |
Artiom | 7:553f3f1c2c53 | 82 | |
kyxstark | 24:33c7ff467bd9 | 83 | automate_ventouse_balance_avant(); |
Artiom | 12:191486ba5118 | 84 | automate_ventouse_balance_arriere(); |
Artiom | 12:191486ba5118 | 85 | |
Artiom | 12:191486ba5118 | 86 | automate_ventouse_relache_arriere(); |
kyxstark | 24:33c7ff467bd9 | 87 | automate_ventouse_relache_avant(); |
Artiom | 14:b1abd2f6df75 | 88 | |
Artiom | 13:9e19048eb065 | 89 | automate_ventouse_sol_avant_relache(); |
Artiom | 14:b1abd2f6df75 | 90 | automate_ventouse_sol_arriere_relache(); |
Artiom | 14:b1abd2f6df75 | 91 | |
Artiom | 14:b1abd2f6df75 | 92 | automate_ventouse_accelerateur_arriere(); |
kyxstark | 24:33c7ff467bd9 | 93 | automate_ventouse_accelerateur_avant(); |
kyxstark | 21:edf6d03fdb20 | 94 | #endif |
kyxstark | 21:edf6d03fdb20 | 95 | |
kyxstark | 21:edf6d03fdb20 | 96 | #ifdef ROBOT_BIG |
kyxstark | 38:9295a9721acb | 97 | automate_ventouse_presentoir_avant(); |
kyxstark | 24:33c7ff467bd9 | 98 | automate_ventouse_goldenium_avant(); |
kyxstark | 24:33c7ff467bd9 | 99 | automate_ventouse_relache_avant(); |
kyxstark | 38:9295a9721acb | 100 | automate_ventouse_accelerateur_avant(); |
Artiom | 31:29500874c1cc | 101 | |
kyxstark | 21:edf6d03fdb20 | 102 | fifo_couleur(); |
kyxstark | 21:edf6d03fdb20 | 103 | ascenseur(); |
Artiom | 44:381ecf63e6ab | 104 | if(cote) { |
Artiom | 44:381ecf63e6ab | 105 | convoyeur_gauche_violet(); |
Artiom | 44:381ecf63e6ab | 106 | convoyeur_droit_violet(); |
Artiom | 44:381ecf63e6ab | 107 | } else { |
Artiom | 44:381ecf63e6ab | 108 | convoyeur_gauche_jaune(); //ok |
Artiom | 44:381ecf63e6ab | 109 | convoyeur_droit_jaune(); //ok |
Artiom | 44:381ecf63e6ab | 110 | } |
kyxstark | 21:edf6d03fdb20 | 111 | |
kyxstark | 21:edf6d03fdb20 | 112 | #endif |
Artiom | 13:9e19048eb065 | 113 | |
Artiom | 0:bc74da1c502f | 114 | if(EtatGameEnd==1) { |
Artiom | 0:bc74da1c502f | 115 | while(1); |
Artiom | 0:bc74da1c502f | 116 | } |
Artiom | 0:bc74da1c502f | 117 | |
Artiom | 0:bc74da1c502f | 118 | } |
Artiom | 0:bc74da1c502f | 119 | } |
Artiom | 0:bc74da1c502f | 120 | |
Artiom | 0:bc74da1c502f | 121 | /****************************************************************************************/ |
Artiom | 0:bc74da1c502f | 122 | /* FUNCTION NAME: canProcessRx */ |
Artiom | 0:bc74da1c502f | 123 | /* DESCRIPTION : Fonction de traitement des messages CAN */ |
Artiom | 0:bc74da1c502f | 124 | /****************************************************************************************/ |
Artiom | 0:bc74da1c502f | 125 | void canProcessRx(void) |
Artiom | 0:bc74da1c502f | 126 | { |
Artiom | 0:bc74da1c502f | 127 | static signed char FIFO_occupation=0,FIFO_max_occupation=0; |
Artiom | 0:bc74da1c502f | 128 | CANMessage msgTx=CANMessage(); |
Artiom | 0:bc74da1c502f | 129 | FIFO_occupation=FIFO_ecriture-FIFO_lecture; |
Artiom | 0:bc74da1c502f | 130 | if(FIFO_occupation<0) |
Artiom | 0:bc74da1c502f | 131 | FIFO_occupation=FIFO_occupation+SIZE_FIFO; |
Artiom | 0:bc74da1c502f | 132 | if(FIFO_max_occupation<FIFO_occupation) |
Artiom | 0:bc74da1c502f | 133 | FIFO_max_occupation=FIFO_occupation; |
Artiom | 0:bc74da1c502f | 134 | if(FIFO_occupation!=0) { |
Artiom | 0:bc74da1c502f | 135 | int identifiant=msgRxBuffer[FIFO_lecture].id; |
Artiom | 0:bc74da1c502f | 136 | |
Artiom | 0:bc74da1c502f | 137 | switch(identifiant) { |
Artiom | 32:e9947815c4d7 | 138 | |
Artiom | 32:e9947815c4d7 | 139 | |
Artiom | 32:e9947815c4d7 | 140 | case CHOICE_COLOR: |
Artiom | 32:e9947815c4d7 | 141 | cote = msgRxBuffer[FIFO_lecture].data[0]; |
Artiom | 36:04c3ad41064d | 142 | /*SendMsgCan(0x788, (unsigned char*)&cote, 1); |
Artiom | 36:04c3ad41064d | 143 | if(cote) printf("\nCote violet : %d",cote); |
Artiom | 36:04c3ad41064d | 144 | else printf("\nCote jaune : %d", cote);*/ |
Artiom | 32:e9947815c4d7 | 145 | break; |
Artiom | 32:e9947815c4d7 | 146 | |
Artiom | 0:bc74da1c502f | 147 | case GLOBAL_GAME_END: |
Artiom | 0:bc74da1c502f | 148 | EtatGameEnd = 1; |
Artiom | 0:bc74da1c502f | 149 | break; |
Artiom | 0:bc74da1c502f | 150 | |
Artiom | 0:bc74da1c502f | 151 | case DATA_TELEMETRE: //Lit le telemetre N°X suivant la data dans le CAN |
Artiom | 0:bc74da1c502f | 152 | char numero_telemetre=msgRxBuffer[FIFO_lecture].data[0]; |
Artiom | 0:bc74da1c502f | 153 | short distance=lecture_telemetre(numero_telemetre); |
Artiom | 0:bc74da1c502f | 154 | |
Artiom | 0:bc74da1c502f | 155 | |
Artiom | 0:bc74da1c502f | 156 | msgTx.id=RECEPTION_DATA; // tx Valeur Telemetre1 |
Artiom | 0:bc74da1c502f | 157 | msgTx.len=2; |
Artiom | 0:bc74da1c502f | 158 | msgTx.format=CANStandard; |
Artiom | 0:bc74da1c502f | 159 | msgTx.type=CANData; |
Artiom | 0:bc74da1c502f | 160 | // Rayon sur 2 octets |
Artiom | 0:bc74da1c502f | 161 | msgTx.data[0]=(unsigned char)distance; |
Artiom | 0:bc74da1c502f | 162 | msgTx.data[1]=(unsigned char)(distance>>8); |
Artiom | 0:bc74da1c502f | 163 | |
Artiom | 0:bc74da1c502f | 164 | can.write(msgTx); |
Artiom | 0:bc74da1c502f | 165 | SendAck(ACKNOWLEDGE_TELEMETRE,RECEPTION_DATA); |
Artiom | 0:bc74da1c502f | 166 | break; |
Artiom | 0:bc74da1c502f | 167 | |
Artiom | 0:bc74da1c502f | 168 | case DATA_RECALAGE: |
Artiom | 0:bc74da1c502f | 169 | short distance1=lecture_telemetre(1); |
Artiom | 0:bc74da1c502f | 170 | short distance2=lecture_telemetre(2); |
Artiom | 0:bc74da1c502f | 171 | short distance3=lecture_telemetre(3); |
Artiom | 0:bc74da1c502f | 172 | short distance4=lecture_telemetre(4); |
Artiom | 0:bc74da1c502f | 173 | |
Artiom | 0:bc74da1c502f | 174 | msgTx.id=RECEPTION_RECALAGE; // tx Valeur Telemetre1 |
Artiom | 0:bc74da1c502f | 175 | msgTx.len=8; |
Artiom | 0:bc74da1c502f | 176 | msgTx.format=CANStandard; |
Artiom | 0:bc74da1c502f | 177 | msgTx.type=CANData; |
Artiom | 0:bc74da1c502f | 178 | // Rayon sur 2 octets |
Artiom | 0:bc74da1c502f | 179 | msgTx.data[0]=(unsigned char)distance1; |
Artiom | 0:bc74da1c502f | 180 | msgTx.data[1]=(unsigned char)(distance1>>8); |
Artiom | 0:bc74da1c502f | 181 | msgTx.data[2]=(unsigned char)distance2; |
Artiom | 0:bc74da1c502f | 182 | msgTx.data[3]=(unsigned char)(distance2>>8); |
Artiom | 0:bc74da1c502f | 183 | msgTx.data[4]=(unsigned char)distance3; |
Artiom | 0:bc74da1c502f | 184 | msgTx.data[5]=(unsigned char)(distance3>>8); |
Artiom | 0:bc74da1c502f | 185 | msgTx.data[6]=(unsigned char)distance4; |
Artiom | 0:bc74da1c502f | 186 | msgTx.data[7]=(unsigned char)(distance4>>8); |
Artiom | 0:bc74da1c502f | 187 | can.write(msgTx); |
Artiom | 0:bc74da1c502f | 188 | SendAck(ACKNOWLEDGE_TELEMETRE,RECEPTION_RECALAGE); |
Artiom | 0:bc74da1c502f | 189 | break; |
Artiom | 44:381ecf63e6ab | 190 | |
Artiom | 44:381ecf63e6ab | 191 | case DATA_TELEMETRE_LOGIQUE: |
Artiom | 43:7fff7f4d79a1 | 192 | msgTx.id=RECEPTION_TELEMETRE_LOGIQUE; // tx Valeur Telemetre1 |
Artiom | 43:7fff7f4d79a1 | 193 | msgTx.len=4; |
Artiom | 43:7fff7f4d79a1 | 194 | msgTx.format=CANStandard; |
Artiom | 43:7fff7f4d79a1 | 195 | msgTx.type=CANData; |
Artiom | 43:7fff7f4d79a1 | 196 | msgTx.data[0]=(unsigned char)DT1_interrupt_Ex; |
Artiom | 43:7fff7f4d79a1 | 197 | msgTx.data[1]=(unsigned char)DT2_interrupt_Ex; |
Artiom | 43:7fff7f4d79a1 | 198 | msgTx.data[2]=(unsigned char)DT3_interrupt_Ex; |
Artiom | 43:7fff7f4d79a1 | 199 | msgTx.data[3]=(unsigned char)DT4_interrupt_Ex; |
Artiom | 43:7fff7f4d79a1 | 200 | can.write(msgTx); |
Artiom | 43:7fff7f4d79a1 | 201 | SendAck(ACKNOWLEDGE_TELEMETRE,RECEPTION_TELEMETRE_LOGIQUE); |
Artiom | 43:7fff7f4d79a1 | 202 | break; |
kyxstark | 25:9627700d989f | 203 | |
kyxstark | 25:9627700d989f | 204 | |
kyxstark | 25:9627700d989f | 205 | //--------------------------------------------------------------------------ACK carte pompe---------------------------------------------- |
kyxstark | 25:9627700d989f | 206 | |
kyxstark | 25:9627700d989f | 207 | |
kyxstark | 25:9627700d989f | 208 | case HACHEUR_STATUT_VENTOUSES: |
kyxstark | 25:9627700d989f | 209 | status_pompe = msgRxBuffer[FIFO_lecture].data[1]; |
kyxstark | 25:9627700d989f | 210 | //can.write(CANMessage(0x529, &status_pompe,1)); |
kyxstark | 25:9627700d989f | 211 | break; |
kyxstark | 25:9627700d989f | 212 | |
kyxstark | 25:9627700d989f | 213 | case HACHEUR_GET_ATOM_ACK: |
kyxstark | 25:9627700d989f | 214 | status_pompe |= (0x01 << msgRxBuffer[FIFO_lecture].data[0]); |
kyxstark | 25:9627700d989f | 215 | //can.write(CANMessage(0x529, &status_pompe,1)); |
kyxstark | 25:9627700d989f | 216 | break; |
kyxstark | 25:9627700d989f | 217 | |
kyxstark | 25:9627700d989f | 218 | case HACHEUR_RELEASE_ATOM_ACK : |
kyxstark | 25:9627700d989f | 219 | status_pompe &= ~(0x01 << msgRxBuffer[FIFO_lecture].data[0]); |
kyxstark | 25:9627700d989f | 220 | break; |
Artiom | 44:381ecf63e6ab | 221 | |
Artiom | 44:381ecf63e6ab | 222 | |
kyxstark | 25:9627700d989f | 223 | |
kyxstark | 25:9627700d989f | 224 | //------------------------------------------------------------------------------------------------------------------------------------------- |
kyxstark | 25:9627700d989f | 225 | |
Artiom | 31:29500874c1cc | 226 | |
kyxstark | 25:9627700d989f | 227 | |
kyxstark | 38:9295a9721acb | 228 | case PRESENTOIR_AVANT: |
kyxstark | 38:9295a9721acb | 229 | fpresentoir_avant=1; |
Artiom | 44:381ecf63e6ab | 230 | |
kyxstark | 38:9295a9721acb | 231 | break; |
kyxstark | 38:9295a9721acb | 232 | |
kyxstark | 38:9295a9721acb | 233 | case GABARIT_ROBOT: |
kyxstark | 38:9295a9721acb | 234 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); |
kyxstark | 38:9295a9721acb | 235 | gabarit_robot(); |
kyxstark | 38:9295a9721acb | 236 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); |
kyxstark | 38:9295a9721acb | 237 | break; |
kyxstark | 38:9295a9721acb | 238 | |
kyxstark | 39:124575240d09 | 239 | case AVANT_RELACHE: |
kyxstark | 39:124575240d09 | 240 | favant_relache=1; |
kyxstark | 39:124575240d09 | 241 | break; |
kyxstark | 38:9295a9721acb | 242 | |
kyxstark | 38:9295a9721acb | 243 | |
kyxstark | 25:9627700d989f | 244 | #ifdef ROBOT_SMALL |
kyxstark | 23:93a427b242ce | 245 | |
kyxstark | 23:93a427b242ce | 246 | |
Artiom | 4:4a79942713fa | 247 | //-------------------------------------------------------------------------Actions petit robot---------------------------------------------- |
Artiom | 32:e9947815c4d7 | 248 | |
kyxstark | 38:9295a9721acb | 249 | |
Artiom | 0:bc74da1c502f | 250 | |
Artiom | 0:bc74da1c502f | 251 | case PRESENTOIR_ARRIERE: |
Artiom | 5:6e198cdd99ad | 252 | fpresentoir_arriere=1; |
Artiom | 0:bc74da1c502f | 253 | break; |
Artiom | 0:bc74da1c502f | 254 | |
Artiom | 31:29500874c1cc | 255 | case BALANCE_AVANT: |
Artiom | 31:29500874c1cc | 256 | fbalance_avant=1; |
Artiom | 31:29500874c1cc | 257 | break; |
Artiom | 32:e9947815c4d7 | 258 | |
Artiom | 0:bc74da1c502f | 259 | case BALANCE_ARRIERE: |
Artiom | 12:191486ba5118 | 260 | fbalance_arriere=1; |
Artiom | 2:9e63099cca99 | 261 | break; |
Artiom | 32:e9947815c4d7 | 262 | |
Artiom | 31:29500874c1cc | 263 | case ACCELERATEUR_AVANT: |
Artiom | 31:29500874c1cc | 264 | faccelerateur_avant=1; |
Artiom | 44:381ecf63e6ab | 265 | distance_recalage=msgRxBuffer[FIFO_lecture].data[0]|((unsigned short)(msgRxBuffer[FIFO_lecture].data[1])<<8); |
Artiom | 44:381ecf63e6ab | 266 | distance_revenir=msgRxBuffer[FIFO_lecture].data[2]|((unsigned short)(msgRxBuffer[FIFO_lecture].data[3])<<8); |
Artiom | 31:29500874c1cc | 267 | break; |
Artiom | 2:9e63099cca99 | 268 | |
Artiom | 2:9e63099cca99 | 269 | case ACCELERATEUR_ARRIERE: |
Artiom | 14:b1abd2f6df75 | 270 | faccelerateur_arriere=1; |
Artiom | 2:9e63099cca99 | 271 | break; |
Artiom | 6:45f9cf44718a | 272 | |
Artiom | 31:29500874c1cc | 273 | case GOLDENIUM_AVANT: |
Artiom | 31:29500874c1cc | 274 | fgoldenium_avant=1; |
Artiom | 44:381ecf63e6ab | 275 | distance_goldenium=msgRxBuffer[FIFO_lecture].data[0]|((unsigned short)(msgRxBuffer[FIFO_lecture].data[1])<<8); |
Artiom | 31:29500874c1cc | 276 | break; |
Artiom | 32:e9947815c4d7 | 277 | |
Artiom | 2:9e63099cca99 | 278 | case GOLDENIUM_ARRIERE: |
Artiom | 6:45f9cf44718a | 279 | fgoldenium_arriere=1; |
Artiom | 2:9e63099cca99 | 280 | break; |
Artiom | 6:45f9cf44718a | 281 | |
Artiom | 2:9e63099cca99 | 282 | case SOL_AVANT: |
Artiom | 6:45f9cf44718a | 283 | fsol_avant=1; |
Artiom | 2:9e63099cca99 | 284 | break; |
Artiom | 2:9e63099cca99 | 285 | |
Artiom | 2:9e63099cca99 | 286 | case SOL_ARRIERE: |
Artiom | 6:45f9cf44718a | 287 | fsol_arriere=1; |
Artiom | 2:9e63099cca99 | 288 | break; |
Artiom | 2:9e63099cca99 | 289 | |
Artiom | 2:9e63099cca99 | 290 | case SOL_AVANT_RELACHE: |
Artiom | 7:553f3f1c2c53 | 291 | fsol_avant_relache=1; |
Artiom | 2:9e63099cca99 | 292 | break; |
Artiom | 2:9e63099cca99 | 293 | |
Artiom | 2:9e63099cca99 | 294 | case SOL_ARRIERE_RELACHE: |
Artiom | 7:553f3f1c2c53 | 295 | fsol_arriere_relache=1; |
Artiom | 0:bc74da1c502f | 296 | break; |
Artiom | 12:191486ba5118 | 297 | |
Artiom | 31:29500874c1cc | 298 | |
Artiom | 44:381ecf63e6ab | 299 | |
Artiom | 32:e9947815c4d7 | 300 | |
Artiom | 12:191486ba5118 | 301 | case ARRIERE_RELACHE: |
Artiom | 12:191486ba5118 | 302 | farriere_relache=1; |
Artiom | 12:191486ba5118 | 303 | break; |
Artiom | 14:b1abd2f6df75 | 304 | case RECROQUEVILLER: |
Artiom | 14:b1abd2f6df75 | 305 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); |
Artiom | 14:b1abd2f6df75 | 306 | recroqueviller_avant(); |
Artiom | 14:b1abd2f6df75 | 307 | recroqueviller_arriere(); |
Artiom | 14:b1abd2f6df75 | 308 | verification(); |
Artiom | 14:b1abd2f6df75 | 309 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); |
Artiom | 14:b1abd2f6df75 | 310 | break; |
Artiom | 13:9e19048eb065 | 311 | |
Artiom | 31:29500874c1cc | 312 | case VENTOUSE_AV_CENTRE_BALANCE: |
Artiom | 31:29500874c1cc | 313 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); |
Artiom | 31:29500874c1cc | 314 | goldenium_avant(); |
Artiom | 31:29500874c1cc | 315 | verification(); |
Artiom | 31:29500874c1cc | 316 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); |
Artiom | 31:29500874c1cc | 317 | break; |
Artiom | 31:29500874c1cc | 318 | |
Artiom | 20:42f8ec726ac8 | 319 | case VENTOUSE_AR_CENTRE_BALANCE: |
Artiom | 20:42f8ec726ac8 | 320 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); |
Artiom | 20:42f8ec726ac8 | 321 | goldenium_arriere(); |
Artiom | 20:42f8ec726ac8 | 322 | positionControl(AR_poigne_D, 200,1,BLED_ON,3);//actionneur |
Artiom | 20:42f8ec726ac8 | 323 | verification(); |
Artiom | 20:42f8ec726ac8 | 324 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); |
Artiom | 20:42f8ec726ac8 | 325 | break; |
Artiom | 32:e9947815c4d7 | 326 | |
Artiom | 31:29500874c1cc | 327 | case ACCELERATEUR_INSERTION_AVANT_GAUCHE: |
Artiom | 31:29500874c1cc | 328 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); |
Artiom | 31:29500874c1cc | 329 | accelerateur_insertion_avant_gauche(); |
Artiom | 31:29500874c1cc | 330 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); |
Artiom | 31:29500874c1cc | 331 | break; |
Artiom | 32:e9947815c4d7 | 332 | |
Artiom | 36:04c3ad41064d | 333 | case ACCELERATEUR_INSERTION_ARRIERE_GAUCHE : |
Artiom | 31:29500874c1cc | 334 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION); |
Artiom | 31:29500874c1cc | 335 | accelerateur_insertion_arriere_gauche(); |
Artiom | 31:29500874c1cc | 336 | SendAck(ACKNOWLEDGE_HERKULEX, ACK_FIN_ACTION); |
Artiom | 31:29500874c1cc | 337 | break; |
Artiom | 0:bc74da1c502f | 338 | |
Artiom | 0:bc74da1c502f | 339 | #endif |
kyxstark | 23:93a427b242ce | 340 | |
Artiom | 0:bc74da1c502f | 341 | #ifdef ROBOT_BIG |
kyxstark | 38:9295a9721acb | 342 | |
kyxstark | 38:9295a9721acb | 343 | |
kyxstark | 21:edf6d03fdb20 | 344 | case ASCENSEUR: |
kyxstark | 22:9e92a2b941ba | 345 | flag_ascenseur = msgRxBuffer[FIFO_lecture].data[0]; |
Artiom | 0:bc74da1c502f | 346 | break; |
Artiom | 0:bc74da1c502f | 347 | |
Artiom | 44:381ecf63e6ab | 348 | case HACHEUR_ETAT_CONTACTS : |
Artiom | 44:381ecf63e6ab | 349 | status_contact = msgRxBuffer[FIFO_lecture].data[0]; |
Artiom | 44:381ecf63e6ab | 350 | break; |
Artiom | 44:381ecf63e6ab | 351 | |
Artiom | 0:bc74da1c502f | 352 | #endif |
Artiom | 0:bc74da1c502f | 353 | } |
Artiom | 0:bc74da1c502f | 354 | FIFO_lecture=(FIFO_lecture+1)%SIZE_FIFO; |
Artiom | 0:bc74da1c502f | 355 | |
Artiom | 0:bc74da1c502f | 356 | } |
Artiom | 4:4a79942713fa | 357 | |
Artiom | 4:4a79942713fa | 358 | |
Artiom | 4:4a79942713fa | 359 | } |
Artiom | 4:4a79942713fa | 360 | |
Artiom | 4:4a79942713fa | 361 | |
Artiom | 4:4a79942713fa | 362 | |
Artiom | 11:6c11c081c855 | 363 |