sequences des strats
Strategie.cpp@3:4810f8316e38, 2019-05-26 (annotated)
- Committer:
- JimmyAREM
- Date:
- Sun May 26 14:57:47 2019 +0000
- Revision:
- 3:4810f8316e38
- Parent:
- 2:e0402d1e9ed5
- Child:
- 4:7a9a9720e4d0
s
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JimmyAREM | 0:a89fe490343e | 1 | #include "Strategie.h" |
JimmyAREM | 0:a89fe490343e | 2 | |
JimmyAREM | 0:a89fe490343e | 3 | char bufferScore[3]={'0','0','0'}; |
JimmyAREM | 1:785b37686185 | 4 | |
JimmyAREM | 0:a89fe490343e | 5 | bool typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 1:785b37686185 | 6 | bool typeEvitement = ARRET; |
JimmyAREM | 0:a89fe490343e | 7 | |
JimmyAREM | 0:a89fe490343e | 8 | extern int distanceUltrasonGauche; |
JimmyAREM | 0:a89fe490343e | 9 | extern int distanceUltrasonDroit; |
JimmyAREM | 0:a89fe490343e | 10 | extern int distanceUltrasonArriere; |
JimmyAREM | 0:a89fe490343e | 11 | |
JimmyAREM | 0:a89fe490343e | 12 | extern int distanceTOF1; |
JimmyAREM | 0:a89fe490343e | 13 | extern int distanceTOF2; |
JimmyAREM | 0:a89fe490343e | 14 | extern int distanceTOF3; |
JimmyAREM | 0:a89fe490343e | 15 | extern int distanceTOF4; |
JimmyAREM | 0:a89fe490343e | 16 | extern int distanceTOF5; |
JimmyAREM | 0:a89fe490343e | 17 | |
JimmyAREM | 0:a89fe490343e | 18 | |
JimmyAREM | 0:a89fe490343e | 19 | extern bool stopCapteurs; |
JimmyAREM | 0:a89fe490343e | 20 | |
JimmyAREM | 0:a89fe490343e | 21 | |
JimmyAREM | 1:785b37686185 | 22 | Timeout tempsArretMvt; |
JimmyAREM | 1:785b37686185 | 23 | |
JimmyAREM | 1:785b37686185 | 24 | |
JimmyAREM | 1:785b37686185 | 25 | |
JimmyAREM | 0:a89fe490343e | 26 | void updateAndWriteScore(char n1, char n2, char n3) |
JimmyAREM | 0:a89fe490343e | 27 | { |
JimmyAREM | 0:a89fe490343e | 28 | bufferScore[0] = n1; |
JimmyAREM | 0:a89fe490343e | 29 | bufferScore[1] = n2; |
JimmyAREM | 0:a89fe490343e | 30 | bufferScore[2] = n3; |
JimmyAREM | 0:a89fe490343e | 31 | write(bufferScore); |
JimmyAREM | 0:a89fe490343e | 32 | } |
JimmyAREM | 0:a89fe490343e | 33 | |
JimmyAREM | 0:a89fe490343e | 34 | void LectureI2CCarteCapteur(deplacement robot) |
JimmyAREM | 0:a89fe490343e | 35 | { |
JimmyAREM | 0:a89fe490343e | 36 | traitementBufferCapteurs(); |
JimmyAREM | 0:a89fe490343e | 37 | if(AnalyseDistance(distanceUltrasonGauche, distanceUltrasonDroit, distanceUltrasonArriere, typeMovement) == ROBOT) |
JimmyAREM | 0:a89fe490343e | 38 | { |
JimmyAREM | 0:a89fe490343e | 39 | if( ((distanceUltrasonGauche <= 300) || (distanceUltrasonDroit <= 300)) && (typeMovement == DEPLACEMENT_AVANT) ) |
JimmyAREM | 0:a89fe490343e | 40 | { |
JimmyAREM | 0:a89fe490343e | 41 | stopCapteurs = true; |
JimmyAREM | 0:a89fe490343e | 42 | } |
JimmyAREM | 0:a89fe490343e | 43 | else if ( (distanceUltrasonArriere <= 300) && (typeMovement == DEPLACEMENT_ARRIERE) ) |
JimmyAREM | 0:a89fe490343e | 44 | { |
JimmyAREM | 0:a89fe490343e | 45 | stopCapteurs = true; |
JimmyAREM | 0:a89fe490343e | 46 | } |
JimmyAREM | 0:a89fe490343e | 47 | else |
JimmyAREM | 0:a89fe490343e | 48 | { |
JimmyAREM | 0:a89fe490343e | 49 | stopCapteurs = false; |
JimmyAREM | 0:a89fe490343e | 50 | } |
JimmyAREM | 0:a89fe490343e | 51 | } |
JimmyAREM | 0:a89fe490343e | 52 | else |
JimmyAREM | 0:a89fe490343e | 53 | { |
JimmyAREM | 0:a89fe490343e | 54 | stopCapteurs = false; |
JimmyAREM | 0:a89fe490343e | 55 | } |
JimmyAREM | 0:a89fe490343e | 56 | } |
JimmyAREM | 0:a89fe490343e | 57 | |
JimmyAREM | 1:785b37686185 | 58 | void arretSystem() |
JimmyAREM | 1:785b37686185 | 59 | { |
JimmyAREM | 1:785b37686185 | 60 | Pompe pompe(PIN_POMPE); |
JimmyAREM | 1:785b37686185 | 61 | Demarreur demarreur(PIN_DEMARREUR); |
JimmyAREM | 1:785b37686185 | 62 | Bras brasGauche(PIN_SERVO_BRAS_GAUCHE, GAUCHE); |
JimmyAREM | 1:785b37686185 | 63 | Bras brasDroit(PIN_SERVO_BRAS_DROIT, DROIT); |
JimmyAREM | 1:785b37686185 | 64 | BrasPousser brasPousserGauche(PIN_SERVO_PALETS_GAUCHE, GAUCHE); |
JimmyAREM | 1:785b37686185 | 65 | BrasPousser brasPousserDroit(PIN_SERVO_PALETS_DROIT,DROIT); |
JimmyAREM | 1:785b37686185 | 66 | deplacement robot; |
JimmyAREM | 1:785b37686185 | 67 | |
JimmyAREM | 1:785b37686185 | 68 | robot.initialisation(); |
JimmyAREM | 1:785b37686185 | 69 | robot.arreterRobot(); |
JimmyAREM | 1:785b37686185 | 70 | pompe.desactiver(); |
JimmyAREM | 1:785b37686185 | 71 | } |
JimmyAREM | 1:785b37686185 | 72 | |
JimmyAREM | 2:e0402d1e9ed5 | 73 | /*---------Debut Strategie homologation violet ------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 74 | |
JimmyAREM | 2:e0402d1e9ed5 | 75 | |
JimmyAREM | 1:785b37686185 | 76 | void strategieHomologationViolet(deplacement robot, Pompe pompe, Demarreur demarreur, Bras brasGauche, Bras brasDroit, BrasPousser brasPousserGauche, BrasPousser brasPousserDroit) |
JimmyAREM | 1:785b37686185 | 77 | { |
JimmyAREM | 1:785b37686185 | 78 | write(bufferScore); |
JimmyAREM | 1:785b37686185 | 79 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 1:785b37686185 | 80 | int etapeMatch = 0; |
JimmyAREM | 1:785b37686185 | 81 | while(demarreur.getState() == false) |
JimmyAREM | 1:785b37686185 | 82 | { |
JimmyAREM | 1:785b37686185 | 83 | //on attend |
JimmyAREM | 1:785b37686185 | 84 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 1:785b37686185 | 85 | } |
JimmyAREM | 1:785b37686185 | 86 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 3:4810f8316e38 | 87 | robot.initialisation(); |
JimmyAREM | 1:785b37686185 | 88 | lancerTimerEcran(); |
JimmyAREM | 1:785b37686185 | 89 | tempsMatch.start(); |
JimmyAREM | 1:785b37686185 | 90 | typeEvitement = ARRET; |
JimmyAREM | 1:785b37686185 | 91 | while(tempsMatch <= TEMPSMATCH) |
JimmyAREM | 1:785b37686185 | 92 | { |
JimmyAREM | 1:785b37686185 | 93 | switch (etapeMatch) { |
JimmyAREM | 1:785b37686185 | 94 | |
JimmyAREM | 1:785b37686185 | 95 | case 0 : /* On tourne pour aller vers le terrain adverse et on avance jusqu'au milieu du terrain */ |
JimmyAREM | 1:785b37686185 | 96 | { |
JimmyAREM | 1:785b37686185 | 97 | typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 1:785b37686185 | 98 | robot.rotation_rel(90); |
JimmyAREM | 1:785b37686185 | 99 | robot.ligne_droite_basique(127500); |
JimmyAREM | 1:785b37686185 | 100 | etapeMatch++; |
JimmyAREM | 1:785b37686185 | 101 | |
JimmyAREM | 1:785b37686185 | 102 | break; |
JimmyAREM | 1:785b37686185 | 103 | } |
JimmyAREM | 1:785b37686185 | 104 | case 1 : /* On se met en position pour pousser les palets */ |
JimmyAREM | 1:785b37686185 | 105 | { |
JimmyAREM | 1:785b37686185 | 106 | robot.rotation_rel(90); |
JimmyAREM | 1:785b37686185 | 107 | robot.ligne_droite_basique(60000); |
JimmyAREM | 1:785b37686185 | 108 | robot.rotation_rel(90); |
JimmyAREM | 1:785b37686185 | 109 | brasPousserDroit.activerBras(); |
JimmyAREM | 1:785b37686185 | 110 | brasPousserGauche.activerBras(); |
JimmyAREM | 1:785b37686185 | 111 | etapeMatch++; |
JimmyAREM | 1:785b37686185 | 112 | |
JimmyAREM | 1:785b37686185 | 113 | break; |
JimmyAREM | 1:785b37686185 | 114 | } |
JimmyAREM | 1:785b37686185 | 115 | case 2 : /* On pousse la zone de chaos dans les cases */ |
JimmyAREM | 1:785b37686185 | 116 | { |
JimmyAREM | 1:785b37686185 | 117 | robot.ligne_droite_basique(110000); |
JimmyAREM | 1:785b37686185 | 118 | updateAndWriteScore('0', '1', '0'); |
JimmyAREM | 1:785b37686185 | 119 | etapeMatch++; |
JimmyAREM | 1:785b37686185 | 120 | |
JimmyAREM | 1:785b37686185 | 121 | break; |
JimmyAREM | 1:785b37686185 | 122 | } |
JimmyAREM | 1:785b37686185 | 123 | case 3 : /* On se met en position pour faire des rectangles */ |
JimmyAREM | 1:785b37686185 | 124 | { |
JimmyAREM | 1:785b37686185 | 125 | typeMovement = DEPLACEMENT_ARRIERE; |
JimmyAREM | 1:785b37686185 | 126 | robot.marche_arriere(-10000); |
JimmyAREM | 1:785b37686185 | 127 | brasPousserDroit.desactiverBras(); |
JimmyAREM | 1:785b37686185 | 128 | brasPousserGauche.desactiverBras(); |
JimmyAREM | 1:785b37686185 | 129 | etapeMatch++; |
JimmyAREM | 1:785b37686185 | 130 | |
JimmyAREM | 1:785b37686185 | 131 | break; |
JimmyAREM | 1:785b37686185 | 132 | } |
JimmyAREM | 1:785b37686185 | 133 | case 4 : /* On fait un rectangle arriere */ |
JimmyAREM | 1:785b37686185 | 134 | { |
JimmyAREM | 1:785b37686185 | 135 | |
JimmyAREM | 1:785b37686185 | 136 | robot.marche_arriere(-50000); |
JimmyAREM | 1:785b37686185 | 137 | robot.rotation_rel(-90); |
JimmyAREM | 1:785b37686185 | 138 | robot.marche_arriere(-50000); |
JimmyAREM | 1:785b37686185 | 139 | robot.rotation_rel(-90); |
JimmyAREM | 1:785b37686185 | 140 | robot.marche_arriere(-50000); |
JimmyAREM | 1:785b37686185 | 141 | robot.rotation_rel(-90); |
JimmyAREM | 1:785b37686185 | 142 | robot.marche_arriere(-50000); |
JimmyAREM | 1:785b37686185 | 143 | //robot.rotation_rel(180); |
JimmyAREM | 1:785b37686185 | 144 | etapeMatch++; |
JimmyAREM | 1:785b37686185 | 145 | |
JimmyAREM | 1:785b37686185 | 146 | break; |
JimmyAREM | 1:785b37686185 | 147 | } |
JimmyAREM | 1:785b37686185 | 148 | case 5 : /* On pousse le palet vert ou le vert et les deux bleus dans la balance en passant par la pente */ |
JimmyAREM | 1:785b37686185 | 149 | { |
JimmyAREM | 1:785b37686185 | 150 | typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 1:785b37686185 | 151 | robot.ligne_droite_basique(50000); |
JimmyAREM | 1:785b37686185 | 152 | robot.rotation_rel(90); |
JimmyAREM | 1:785b37686185 | 153 | robot.ligne_droite_basique(50000); |
JimmyAREM | 1:785b37686185 | 154 | robot.rotation_rel(90); |
JimmyAREM | 1:785b37686185 | 155 | robot.ligne_droite_basique(50000); |
JimmyAREM | 1:785b37686185 | 156 | robot.rotation_rel(90); |
JimmyAREM | 1:785b37686185 | 157 | robot.ligne_droite_basique(50000); |
JimmyAREM | 1:785b37686185 | 158 | robot.rotation_rel(90); |
JimmyAREM | 1:785b37686185 | 159 | etapeMatch++; |
JimmyAREM | 1:785b37686185 | 160 | |
JimmyAREM | 1:785b37686185 | 161 | break; |
JimmyAREM | 1:785b37686185 | 162 | } |
JimmyAREM | 1:785b37686185 | 163 | |
JimmyAREM | 1:785b37686185 | 164 | default: |
JimmyAREM | 1:785b37686185 | 165 | { |
JimmyAREM | 1:785b37686185 | 166 | robot.vitesse_nulle_D(0); |
JimmyAREM | 1:785b37686185 | 167 | robot.vitesse_nulle_G(0); |
JimmyAREM | 1:785b37686185 | 168 | motors_stop(); |
JimmyAREM | 1:785b37686185 | 169 | } |
JimmyAREM | 1:785b37686185 | 170 | } |
JimmyAREM | 1:785b37686185 | 171 | } |
JimmyAREM | 1:785b37686185 | 172 | |
JimmyAREM | 1:785b37686185 | 173 | //Arrêter les moteurs |
JimmyAREM | 1:785b37686185 | 174 | robot.vitesse_nulle_D(0); |
JimmyAREM | 1:785b37686185 | 175 | robot.vitesse_nulle_G(0); |
JimmyAREM | 1:785b37686185 | 176 | motors_stop(); |
JimmyAREM | 1:785b37686185 | 177 | while(1); |
JimmyAREM | 1:785b37686185 | 178 | } |
JimmyAREM | 1:785b37686185 | 179 | |
JimmyAREM | 2:e0402d1e9ed5 | 180 | /*-------Fin Stratégie homologation violet------------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 181 | |
JimmyAREM | 2:e0402d1e9ed5 | 182 | |
JimmyAREM | 2:e0402d1e9ed5 | 183 | /*-------Debut Strategie homologation jaune-----------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 184 | |
JimmyAREM | 2:e0402d1e9ed5 | 185 | void strategieHomologationJaune(deplacement robot, Pompe pompe, Demarreur demarreur, Bras brasGauche, Bras brasDroit, BrasPousser brasPousserGauche, BrasPousser brasPousserDroit) |
JimmyAREM | 2:e0402d1e9ed5 | 186 | { |
JimmyAREM | 2:e0402d1e9ed5 | 187 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 188 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 189 | int etapeMatch = 0; |
JimmyAREM | 2:e0402d1e9ed5 | 190 | while(demarreur.getState() == false) |
JimmyAREM | 2:e0402d1e9ed5 | 191 | { |
JimmyAREM | 2:e0402d1e9ed5 | 192 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 193 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 194 | } |
JimmyAREM | 2:e0402d1e9ed5 | 195 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 3:4810f8316e38 | 196 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 197 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 198 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 199 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 200 | } |
JimmyAREM | 2:e0402d1e9ed5 | 201 | |
JimmyAREM | 2:e0402d1e9ed5 | 202 | /*Fin Strategie homologation jaune -------------------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 203 | |
JimmyAREM | 2:e0402d1e9ed5 | 204 | |
JimmyAREM | 2:e0402d1e9ed5 | 205 | /*Debut Strategie classique violet -------------------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 206 | |
JimmyAREM | 2:e0402d1e9ed5 | 207 | |
JimmyAREM | 0:a89fe490343e | 208 | void strategieClassiqueViolet(deplacement robot, Pompe pompe, Demarreur demarreur, Bras brasGauche, Bras brasDroit, BrasPousser brasPousserGauche, BrasPousser brasPousserDroit) |
JimmyAREM | 0:a89fe490343e | 209 | { |
JimmyAREM | 0:a89fe490343e | 210 | write(bufferScore); |
JimmyAREM | 0:a89fe490343e | 211 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 0:a89fe490343e | 212 | int etapeMatch = 0; |
JimmyAREM | 0:a89fe490343e | 213 | while(demarreur.getState() == false) |
JimmyAREM | 0:a89fe490343e | 214 | { |
JimmyAREM | 0:a89fe490343e | 215 | //on attend |
JimmyAREM | 0:a89fe490343e | 216 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 0:a89fe490343e | 217 | } |
JimmyAREM | 1:785b37686185 | 218 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 3:4810f8316e38 | 219 | robot.initialisation(); |
JimmyAREM | 0:a89fe490343e | 220 | lancerTimerEcran(); |
JimmyAREM | 0:a89fe490343e | 221 | tempsMatch.start(); |
JimmyAREM | 0:a89fe490343e | 222 | while(tempsMatch <= TEMPSMATCH) |
JimmyAREM | 0:a89fe490343e | 223 | { |
JimmyAREM | 0:a89fe490343e | 224 | switch (etapeMatch) { |
JimmyAREM | 0:a89fe490343e | 225 | |
JimmyAREM | 0:a89fe490343e | 226 | case 0 : /* On active l'expérience */ |
JimmyAREM | 0:a89fe490343e | 227 | { |
JimmyAREM | 0:a89fe490343e | 228 | typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 2:e0402d1e9ed5 | 229 | robot.ligne_droite_basique(26500); |
JimmyAREM | 0:a89fe490343e | 230 | robot.poussette(300); |
JimmyAREM | 0:a89fe490343e | 231 | updateAndWriteScore('0', '4', '0'); |
JimmyAREM | 0:a89fe490343e | 232 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 233 | |
JimmyAREM | 0:a89fe490343e | 234 | break; |
JimmyAREM | 0:a89fe490343e | 235 | } |
JimmyAREM | 0:a89fe490343e | 236 | case 1 : /* On pousse le palet bleu de la pente de l'accélérateur */ |
JimmyAREM | 0:a89fe490343e | 237 | { |
JimmyAREM | 0:a89fe490343e | 238 | typeMovement = DEPLACEMENT_ARRIERE; |
JimmyAREM | 0:a89fe490343e | 239 | robot.marche_arriere(-11200); |
JimmyAREM | 0:a89fe490343e | 240 | typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 2:e0402d1e9ed5 | 241 | /*robot.rotation_rel(90); |
JimmyAREM | 2:e0402d1e9ed5 | 242 | robot.ligne_droite_basique(130000);*/ |
JimmyAREM | 2:e0402d1e9ed5 | 243 | robot.va_au_point(160000,24300,0); |
JimmyAREM | 0:a89fe490343e | 244 | brasDroit.activerBras(); |
JimmyAREM | 2:e0402d1e9ed5 | 245 | robot.ligne_droite_basique(14000); |
JimmyAREM | 0:a89fe490343e | 246 | brasDroit.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 247 | updateAndWriteScore('0', '5', '0'); |
JimmyAREM | 0:a89fe490343e | 248 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 249 | |
JimmyAREM | 0:a89fe490343e | 250 | break; |
JimmyAREM | 0:a89fe490343e | 251 | } |
JimmyAREM | 0:a89fe490343e | 252 | case 2 : /* On récupère le goldenium */ |
JimmyAREM | 0:a89fe490343e | 253 | { |
JimmyAREM | 2:e0402d1e9ed5 | 254 | robot.va_au_point(223000,30000,-90); |
JimmyAREM | 2:e0402d1e9ed5 | 255 | //robot.ligne_droite_basique(54500); |
JimmyAREM | 2:e0402d1e9ed5 | 256 | //robot.rotation_rel(-90); |
JimmyAREM | 0:a89fe490343e | 257 | pompe.activer(); |
JimmyAREM | 2:e0402d1e9ed5 | 258 | robot.poussette(1500); |
JimmyAREM | 0:a89fe490343e | 259 | typeMovement = DEPLACEMENT_ARRIERE; |
JimmyAREM | 0:a89fe490343e | 260 | robot.marche_arriere(-10000); |
JimmyAREM | 0:a89fe490343e | 261 | typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 0:a89fe490343e | 262 | updateAndWriteScore('0', '8', '0'); |
JimmyAREM | 0:a89fe490343e | 263 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 264 | |
JimmyAREM | 0:a89fe490343e | 265 | break; |
JimmyAREM | 0:a89fe490343e | 266 | } |
JimmyAREM | 0:a89fe490343e | 267 | case 3 : /* On met le goldenium dans la balance */ |
JimmyAREM | 0:a89fe490343e | 268 | { |
JimmyAREM | 2:e0402d1e9ed5 | 269 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 270 | robot.va_au_point(130700,115000,90); |
JimmyAREM | 2:e0402d1e9ed5 | 271 | robot.ligne_droite_basique(15000); |
JimmyAREM | 2:e0402d1e9ed5 | 272 | /*robot.rotation_rel(-90); |
JimmyAREM | 2:e0402d1e9ed5 | 273 | robot.ligne_droite_basique(93000); |
JimmyAREM | 0:a89fe490343e | 274 | robot.rotation_rel(-90); |
JimmyAREM | 2:e0402d1e9ed5 | 275 | robot.ligne_droite_basique(104000);*/ |
JimmyAREM | 2:e0402d1e9ed5 | 276 | robot.poussette(1500); |
JimmyAREM | 0:a89fe490343e | 277 | pompe.desactiver(); |
JimmyAREM | 0:a89fe490343e | 278 | wait(2); |
JimmyAREM | 0:a89fe490343e | 279 | updateAndWriteScore('1', '0', '4'); |
JimmyAREM | 0:a89fe490343e | 280 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 281 | |
JimmyAREM | 0:a89fe490343e | 282 | break; |
JimmyAREM | 0:a89fe490343e | 283 | } |
JimmyAREM | 0:a89fe490343e | 284 | case 4 : /* On pousse la zone de chaos dans la zone du redium */ |
JimmyAREM | 0:a89fe490343e | 285 | { |
JimmyAREM | 0:a89fe490343e | 286 | typeMovement = DEPLACEMENT_ARRIERE; |
JimmyAREM | 0:a89fe490343e | 287 | robot.marche_arriere(-8000); |
JimmyAREM | 0:a89fe490343e | 288 | typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 2:e0402d1e9ed5 | 289 | robot.rotation_rel(130); |
JimmyAREM | 0:a89fe490343e | 290 | brasPousserGauche.activerBras(); |
JimmyAREM | 0:a89fe490343e | 291 | brasPousserDroit.activerBras(); |
JimmyAREM | 2:e0402d1e9ed5 | 292 | robot.ligne_droite_basique(117500); |
JimmyAREM | 0:a89fe490343e | 293 | updateAndWriteScore('1', '2', '4'); |
JimmyAREM | 0:a89fe490343e | 294 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 295 | |
JimmyAREM | 0:a89fe490343e | 296 | break; |
JimmyAREM | 0:a89fe490343e | 297 | } |
JimmyAREM | 0:a89fe490343e | 298 | case 5 : /* On pousse le palet vert ou le vert et les deux bleus dans la balance en passant par la pente */ |
JimmyAREM | 0:a89fe490343e | 299 | { |
JimmyAREM | 0:a89fe490343e | 300 | brasPousserGauche.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 301 | brasPousserDroit.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 302 | typeMovement = DEPLACEMENT_ARRIERE; |
JimmyAREM | 0:a89fe490343e | 303 | robot.marche_arriere(-8000); |
JimmyAREM | 0:a89fe490343e | 304 | typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 2:e0402d1e9ed5 | 305 | /*robot.rotation_rel(-90); |
JimmyAREM | 1:785b37686185 | 306 | robot.ligne_droite_basique(45000); |
JimmyAREM | 0:a89fe490343e | 307 | robot.rotation_rel(-42); |
JimmyAREM | 1:785b37686185 | 308 | robot.ligne_droite_basique(86000); |
JimmyAREM | 2:e0402d1e9ed5 | 309 | robot.rotation_rel(-90);*/ |
JimmyAREM | 2:e0402d1e9ed5 | 310 | robot.va_au_point(18000,179500,0); |
JimmyAREM | 2:e0402d1e9ed5 | 311 | robot.ligne_droite_basique(5000); |
JimmyAREM | 0:a89fe490343e | 312 | brasPousserGauche.activerBras(); |
JimmyAREM | 0:a89fe490343e | 313 | brasPousserDroit.activerBras(); |
JimmyAREM | 0:a89fe490343e | 314 | //mettre la fonction pente |
JimmyAREM | 2:e0402d1e9ed5 | 315 | |
JimmyAREM | 2:e0402d1e9ed5 | 316 | /*robot.commande_vitesse(30,30); |
JimmyAREM | 0:a89fe490343e | 317 | wait(7); |
JimmyAREM | 0:a89fe490343e | 318 | robot.commande_vitesse(150,150); |
JimmyAREM | 2:e0402d1e9ed5 | 319 | wait(3);*/ |
JimmyAREM | 0:a89fe490343e | 320 | updateAndWriteScore('1', '3', '4'); |
JimmyAREM | 0:a89fe490343e | 321 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 322 | |
JimmyAREM | 0:a89fe490343e | 323 | break; |
JimmyAREM | 0:a89fe490343e | 324 | } |
JimmyAREM | 0:a89fe490343e | 325 | case 6 : /* On redescant de la pente */ |
JimmyAREM | 0:a89fe490343e | 326 | { |
JimmyAREM | 2:e0402d1e9ed5 | 327 | pompe.activer(); |
JimmyAREM | 2:e0402d1e9ed5 | 328 | robot.pente_combo(brasPousserGauche,brasPousserDroit,pompe); |
JimmyAREM | 2:e0402d1e9ed5 | 329 | /*robot.commande_vitesse(-30,-30); |
JimmyAREM | 0:a89fe490343e | 330 | wait(2); |
JimmyAREM | 0:a89fe490343e | 331 | brasPousserGauche.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 332 | brasPousserDroit.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 333 | robot.commande_vitesse(-50,-50); |
JimmyAREM | 2:e0402d1e9ed5 | 334 | wait_ms(10000);*/ |
JimmyAREM | 0:a89fe490343e | 335 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 336 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 337 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 338 | |
JimmyAREM | 0:a89fe490343e | 339 | break; |
JimmyAREM | 0:a89fe490343e | 340 | } |
JimmyAREM | 0:a89fe490343e | 341 | default: |
JimmyAREM | 0:a89fe490343e | 342 | { |
JimmyAREM | 0:a89fe490343e | 343 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 344 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 345 | motors_stop(); |
JimmyAREM | 0:a89fe490343e | 346 | pompe.desactiver(); |
JimmyAREM | 0:a89fe490343e | 347 | } |
JimmyAREM | 0:a89fe490343e | 348 | } |
JimmyAREM | 0:a89fe490343e | 349 | } |
JimmyAREM | 0:a89fe490343e | 350 | |
JimmyAREM | 0:a89fe490343e | 351 | //Arrêter les moteurs |
JimmyAREM | 0:a89fe490343e | 352 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 353 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 354 | motors_stop(); |
JimmyAREM | 0:a89fe490343e | 355 | pompe.desactiver(); |
JimmyAREM | 0:a89fe490343e | 356 | while(1); |
JimmyAREM | 0:a89fe490343e | 357 | } |
JimmyAREM | 0:a89fe490343e | 358 | |
JimmyAREM | 0:a89fe490343e | 359 | |
JimmyAREM | 2:e0402d1e9ed5 | 360 | /*-------- Fin Strategie classique violet -----------------------------------------------*/ |
JimmyAREM | 0:a89fe490343e | 361 | |
JimmyAREM | 0:a89fe490343e | 362 | |
JimmyAREM | 2:e0402d1e9ed5 | 363 | /*------- Debut Strategie classique Jaune -----------------------------------------------*/ |
JimmyAREM | 0:a89fe490343e | 364 | |
JimmyAREM | 0:a89fe490343e | 365 | |
JimmyAREM | 0:a89fe490343e | 366 | void strategieClassiqueJaune(deplacement robot, Pompe pompe, Demarreur demarreur, Bras brasGauche, Bras brasDroit, BrasPousser brasPousserGauche, BrasPousser brasPousserDroit) |
JimmyAREM | 0:a89fe490343e | 367 | { |
JimmyAREM | 0:a89fe490343e | 368 | write(bufferScore); |
JimmyAREM | 0:a89fe490343e | 369 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 370 | int etapeMatch = 0; |
JimmyAREM | 0:a89fe490343e | 371 | while(demarreur.getState() == false) |
JimmyAREM | 0:a89fe490343e | 372 | { |
JimmyAREM | 0:a89fe490343e | 373 | //on attend |
JimmyAREM | 0:a89fe490343e | 374 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 0:a89fe490343e | 375 | } |
JimmyAREM | 1:785b37686185 | 376 | tempsArretMvt.attach(&arretSystem, 100.0); |
JimmyAREM | 3:4810f8316e38 | 377 | robot.initialisation(); |
JimmyAREM | 0:a89fe490343e | 378 | lancerTimerEcran(); |
JimmyAREM | 0:a89fe490343e | 379 | tempsMatch.start(); |
JimmyAREM | 0:a89fe490343e | 380 | while(tempsMatch <= TEMPSMATCH) |
JimmyAREM | 0:a89fe490343e | 381 | { |
JimmyAREM | 0:a89fe490343e | 382 | switch (etapeMatch) { |
JimmyAREM | 0:a89fe490343e | 383 | |
JimmyAREM | 0:a89fe490343e | 384 | case 0 : /* On active l'expérience */ |
JimmyAREM | 0:a89fe490343e | 385 | { |
JimmyAREM | 1:785b37686185 | 386 | robot.ligne_droite_basique(25000); |
JimmyAREM | 0:a89fe490343e | 387 | robot.poussette(300); |
JimmyAREM | 0:a89fe490343e | 388 | updateAndWriteScore('0', '4', '0'); |
JimmyAREM | 0:a89fe490343e | 389 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 390 | |
JimmyAREM | 0:a89fe490343e | 391 | break; |
JimmyAREM | 0:a89fe490343e | 392 | } |
JimmyAREM | 0:a89fe490343e | 393 | case 1 : /* On pousse le palet bleu de la pente de l'accélérateur */ |
JimmyAREM | 0:a89fe490343e | 394 | { |
JimmyAREM | 0:a89fe490343e | 395 | robot.marche_arriere(-11200); |
JimmyAREM | 0:a89fe490343e | 396 | robot.rotation_rel(-90); |
JimmyAREM | 1:785b37686185 | 397 | robot.ligne_droite_basique(130000); |
JimmyAREM | 0:a89fe490343e | 398 | brasDroit.activerBras(); |
JimmyAREM | 1:785b37686185 | 399 | robot.ligne_droite_basique(16000); |
JimmyAREM | 0:a89fe490343e | 400 | brasDroit.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 401 | updateAndWriteScore('0', '5', '0'); |
JimmyAREM | 0:a89fe490343e | 402 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 403 | |
JimmyAREM | 0:a89fe490343e | 404 | break; |
JimmyAREM | 0:a89fe490343e | 405 | } |
JimmyAREM | 0:a89fe490343e | 406 | case 2 : /* On récupère le goldenium */ |
JimmyAREM | 0:a89fe490343e | 407 | { |
JimmyAREM | 1:785b37686185 | 408 | robot.ligne_droite_basique(54500); |
JimmyAREM | 0:a89fe490343e | 409 | robot.rotation_rel(90); |
JimmyAREM | 0:a89fe490343e | 410 | pompe.activer(); |
JimmyAREM | 0:a89fe490343e | 411 | robot.poussette(1000); |
JimmyAREM | 0:a89fe490343e | 412 | robot.marche_arriere(-10000); |
JimmyAREM | 0:a89fe490343e | 413 | updateAndWriteScore('0', '8', '0'); |
JimmyAREM | 0:a89fe490343e | 414 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 415 | |
JimmyAREM | 0:a89fe490343e | 416 | break; |
JimmyAREM | 0:a89fe490343e | 417 | } |
JimmyAREM | 0:a89fe490343e | 418 | case 3 : /* On met le goldenium dans la balance */ |
JimmyAREM | 0:a89fe490343e | 419 | { |
JimmyAREM | 0:a89fe490343e | 420 | |
JimmyAREM | 0:a89fe490343e | 421 | robot.rotation_rel(90); |
JimmyAREM | 1:785b37686185 | 422 | robot.ligne_droite_basique(96000); |
JimmyAREM | 0:a89fe490343e | 423 | robot.rotation_rel(90); |
JimmyAREM | 1:785b37686185 | 424 | robot.ligne_droite_basique(104000); |
JimmyAREM | 0:a89fe490343e | 425 | robot.poussette(1000); |
JimmyAREM | 0:a89fe490343e | 426 | pompe.desactiver(); |
JimmyAREM | 0:a89fe490343e | 427 | wait(2); |
JimmyAREM | 0:a89fe490343e | 428 | updateAndWriteScore('1', '0', '4'); |
JimmyAREM | 0:a89fe490343e | 429 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 430 | |
JimmyAREM | 0:a89fe490343e | 431 | break; |
JimmyAREM | 0:a89fe490343e | 432 | } |
JimmyAREM | 0:a89fe490343e | 433 | case 4 : /* On pousse la zone de chaos dans la zone du redium */ |
JimmyAREM | 0:a89fe490343e | 434 | { |
JimmyAREM | 0:a89fe490343e | 435 | |
JimmyAREM | 0:a89fe490343e | 436 | robot.marche_arriere(-8000); |
JimmyAREM | 0:a89fe490343e | 437 | robot.rotation_rel(-135); |
JimmyAREM | 0:a89fe490343e | 438 | brasPousserGauche.activerBras(); |
JimmyAREM | 0:a89fe490343e | 439 | brasPousserDroit.activerBras(); |
JimmyAREM | 1:785b37686185 | 440 | robot.ligne_droite_basique(112500); |
JimmyAREM | 0:a89fe490343e | 441 | updateAndWriteScore('1', '2', '4'); |
JimmyAREM | 0:a89fe490343e | 442 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 443 | |
JimmyAREM | 0:a89fe490343e | 444 | break; |
JimmyAREM | 0:a89fe490343e | 445 | } |
JimmyAREM | 0:a89fe490343e | 446 | case 5 : /* On pousse le palet vert ou le vert et les deux bleus dans la balance en passant par la pente */ |
JimmyAREM | 0:a89fe490343e | 447 | { |
JimmyAREM | 0:a89fe490343e | 448 | brasPousserGauche.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 449 | brasPousserDroit.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 450 | /*robot.marche_arriere(-8000); |
JimmyAREM | 0:a89fe490343e | 451 | robot.rotation_rel(-90); |
JimmyAREM | 0:a89fe490343e | 452 | robot.ligne_droite(45000); |
JimmyAREM | 0:a89fe490343e | 453 | robot.rotation_rel(-42); |
JimmyAREM | 0:a89fe490343e | 454 | robot.ligne_droite(86000);*/ |
JimmyAREM | 0:a89fe490343e | 455 | robot.rotation_rel(90); |
JimmyAREM | 0:a89fe490343e | 456 | brasPousserGauche.activerBras(); |
JimmyAREM | 0:a89fe490343e | 457 | brasPousserDroit.activerBras(); |
JimmyAREM | 0:a89fe490343e | 458 | robot.commande_vitesse(30,30); |
JimmyAREM | 0:a89fe490343e | 459 | wait(7); |
JimmyAREM | 0:a89fe490343e | 460 | robot.commande_vitesse(150,150); |
JimmyAREM | 0:a89fe490343e | 461 | wait(3); |
JimmyAREM | 0:a89fe490343e | 462 | updateAndWriteScore('1', '3', '4'); |
JimmyAREM | 0:a89fe490343e | 463 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 464 | |
JimmyAREM | 0:a89fe490343e | 465 | break; |
JimmyAREM | 0:a89fe490343e | 466 | } |
JimmyAREM | 0:a89fe490343e | 467 | case 6 : /* On redescant de la pente */ |
JimmyAREM | 0:a89fe490343e | 468 | { |
JimmyAREM | 0:a89fe490343e | 469 | robot.commande_vitesse(-30,-30); |
JimmyAREM | 0:a89fe490343e | 470 | wait(2); |
JimmyAREM | 0:a89fe490343e | 471 | brasPousserGauche.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 472 | brasPousserDroit.desactiverBras(); |
JimmyAREM | 0:a89fe490343e | 473 | robot.commande_vitesse(-50,-50); |
JimmyAREM | 0:a89fe490343e | 474 | wait_ms(10000); |
JimmyAREM | 0:a89fe490343e | 475 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 476 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 477 | etapeMatch++; |
JimmyAREM | 0:a89fe490343e | 478 | |
JimmyAREM | 0:a89fe490343e | 479 | break; |
JimmyAREM | 0:a89fe490343e | 480 | } |
JimmyAREM | 0:a89fe490343e | 481 | default: |
JimmyAREM | 0:a89fe490343e | 482 | { |
JimmyAREM | 0:a89fe490343e | 483 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 484 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 485 | motors_stop(); |
JimmyAREM | 0:a89fe490343e | 486 | } |
JimmyAREM | 0:a89fe490343e | 487 | } |
JimmyAREM | 0:a89fe490343e | 488 | } |
JimmyAREM | 0:a89fe490343e | 489 | |
JimmyAREM | 0:a89fe490343e | 490 | //Arrêter les moteurs |
JimmyAREM | 0:a89fe490343e | 491 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 492 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 493 | motors_stop(); |
JimmyAREM | 0:a89fe490343e | 494 | while(1); |
JimmyAREM | 2:e0402d1e9ed5 | 495 | } |
JimmyAREM | 2:e0402d1e9ed5 | 496 | |
JimmyAREM | 2:e0402d1e9ed5 | 497 | /*--------- Fin Strategie classique jaune --------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 498 | |
JimmyAREM | 2:e0402d1e9ed5 | 499 | |
JimmyAREM | 2:e0402d1e9ed5 | 500 | /*--------- Debut Strategie RCVA violet ----------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 501 | |
JimmyAREM | 2:e0402d1e9ed5 | 502 | |
JimmyAREM | 2:e0402d1e9ed5 | 503 | void strategieRCVAViolet(deplacement robot, Pompe pompe, Demarreur demarreur, Bras brasGauche, Bras brasDroit, BrasPousser brasPousserGauche, BrasPousser brasPousserDroit) |
JimmyAREM | 2:e0402d1e9ed5 | 504 | { |
JimmyAREM | 2:e0402d1e9ed5 | 505 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 506 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 507 | int etapeMatch = 0; |
JimmyAREM | 2:e0402d1e9ed5 | 508 | while(demarreur.getState() == false) |
JimmyAREM | 2:e0402d1e9ed5 | 509 | { |
JimmyAREM | 2:e0402d1e9ed5 | 510 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 511 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 512 | } |
JimmyAREM | 2:e0402d1e9ed5 | 513 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 3:4810f8316e38 | 514 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 515 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 516 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 517 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 518 | } |
JimmyAREM | 2:e0402d1e9ed5 | 519 | |
JimmyAREM | 2:e0402d1e9ed5 | 520 | |
JimmyAREM | 2:e0402d1e9ed5 | 521 | /*-------- Fin Strategie RCVA violet -----------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 522 | |
JimmyAREM | 2:e0402d1e9ed5 | 523 | |
JimmyAREM | 2:e0402d1e9ed5 | 524 | /*-------- Debut Strategie RCVA jaune -----------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 525 | |
JimmyAREM | 2:e0402d1e9ed5 | 526 | void strategieRCVAJaune(deplacement robot, Pompe pompe, Demarreur demarreur, Bras brasGauche, Bras brasDroit, BrasPousser brasPousserGauche, BrasPousser brasPousserDroit) |
JimmyAREM | 2:e0402d1e9ed5 | 527 | { |
JimmyAREM | 2:e0402d1e9ed5 | 528 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 529 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 530 | int etapeMatch = 0; |
JimmyAREM | 2:e0402d1e9ed5 | 531 | while(demarreur.getState() == false) |
JimmyAREM | 2:e0402d1e9ed5 | 532 | { |
JimmyAREM | 2:e0402d1e9ed5 | 533 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 534 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 535 | } |
JimmyAREM | 2:e0402d1e9ed5 | 536 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 3:4810f8316e38 | 537 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 538 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 539 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 540 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 541 | } |
JimmyAREM | 2:e0402d1e9ed5 | 542 | |
JimmyAREM | 2:e0402d1e9ed5 | 543 | |
JimmyAREM | 2:e0402d1e9ed5 | 544 | /*-------- Fin Strategie RCVA jaune --------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 545 | |
JimmyAREM | 2:e0402d1e9ed5 | 546 | /*-------- Debut Strategie humiliation violet ---------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 547 | |
JimmyAREM | 2:e0402d1e9ed5 | 548 | void strategieHumiliationViolet(deplacement robot, Pompe pompe, Demarreur demarreur, Bras brasGauche, Bras brasDroit, BrasPousser brasPousserGauche, BrasPousser brasPousserDroit) |
JimmyAREM | 2:e0402d1e9ed5 | 549 | { |
JimmyAREM | 2:e0402d1e9ed5 | 550 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 551 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 552 | int etapeMatch = 0; |
JimmyAREM | 2:e0402d1e9ed5 | 553 | while(demarreur.getState() == false) |
JimmyAREM | 2:e0402d1e9ed5 | 554 | { |
JimmyAREM | 2:e0402d1e9ed5 | 555 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 556 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 557 | } |
JimmyAREM | 2:e0402d1e9ed5 | 558 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 3:4810f8316e38 | 559 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 560 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 561 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 562 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 563 | } |
JimmyAREM | 2:e0402d1e9ed5 | 564 | |
JimmyAREM | 2:e0402d1e9ed5 | 565 | |
JimmyAREM | 2:e0402d1e9ed5 | 566 | /*--------- Fin Strategie humiliation violet ----------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 567 | |
JimmyAREM | 2:e0402d1e9ed5 | 568 | |
JimmyAREM | 2:e0402d1e9ed5 | 569 | /*-------- Debut Strategie humiliation jaune ----------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 570 | |
JimmyAREM | 2:e0402d1e9ed5 | 571 | void strategieHumiliationJaune(deplacement robot, Pompe pompe, Demarreur demarreur, Bras brasGauche, Bras brasDroit, BrasPousser brasPousserGauche, BrasPousser brasPousserDroit) |
JimmyAREM | 2:e0402d1e9ed5 | 572 | { |
JimmyAREM | 2:e0402d1e9ed5 | 573 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 574 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 575 | int etapeMatch = 0; |
JimmyAREM | 2:e0402d1e9ed5 | 576 | while(demarreur.getState() == false) |
JimmyAREM | 2:e0402d1e9ed5 | 577 | { |
JimmyAREM | 2:e0402d1e9ed5 | 578 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 579 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 580 | } |
JimmyAREM | 2:e0402d1e9ed5 | 581 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 3:4810f8316e38 | 582 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 583 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 584 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 585 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 586 | } |
JimmyAREM | 2:e0402d1e9ed5 | 587 | |
JimmyAREM | 2:e0402d1e9ed5 | 588 | |
JimmyAREM | 2:e0402d1e9ed5 | 589 | /*--------- Fin Strategie humiliation jaune -----------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 590 | |
JimmyAREM | 2:e0402d1e9ed5 | 591 | |
JimmyAREM | 2:e0402d1e9ed5 | 592 | |
JimmyAREM | 2:e0402d1e9ed5 | 593 |