sequences des strats
Strategie.cpp@7:392aa81893eb, 2019-05-30 (annotated)
- Committer:
- JimmyAREM
- Date:
- Thu May 30 03:00:55 2019 +0000
- Revision:
- 7:392aa81893eb
- Parent:
- 6:db41c3f7245e
- Child:
- 8:55fe932fd696
C
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 | 7:392aa81893eb | 3 | char bufferScore[3]= {'0','0','0'}; |
JimmyAREM | 1:785b37686185 | 4 | |
JimmyAREM | 0:a89fe490343e | 5 | bool typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 4:7a9a9720e4d0 | 6 | int typeEvitement = ARRET; |
JimmyAREM | 0:a89fe490343e | 7 | |
JimmyAREM | 7:392aa81893eb | 8 | extern bool finActions; |
JimmyAREM | 0:a89fe490343e | 9 | extern int distanceUltrasonGauche; |
JimmyAREM | 0:a89fe490343e | 10 | extern int distanceUltrasonDroit; |
JimmyAREM | 0:a89fe490343e | 11 | extern int distanceUltrasonArriere; |
JimmyAREM | 0:a89fe490343e | 12 | |
JimmyAREM | 0:a89fe490343e | 13 | extern int distanceTOF1; |
JimmyAREM | 0:a89fe490343e | 14 | extern int distanceTOF2; |
JimmyAREM | 0:a89fe490343e | 15 | extern int distanceTOF3; |
JimmyAREM | 0:a89fe490343e | 16 | extern int distanceTOF4; |
JimmyAREM | 0:a89fe490343e | 17 | extern int distanceTOF5; |
JimmyAREM | 0:a89fe490343e | 18 | |
JimmyAREM | 0:a89fe490343e | 19 | |
JimmyAREM | 0:a89fe490343e | 20 | extern bool stopCapteurs; |
JimmyAREM | 0:a89fe490343e | 21 | |
JimmyAREM | 0:a89fe490343e | 22 | |
JimmyAREM | 1:785b37686185 | 23 | Timeout tempsArretMvt; |
JimmyAREM | 1:785b37686185 | 24 | |
JimmyAREM | 1:785b37686185 | 25 | |
JimmyAREM | 1:785b37686185 | 26 | |
JimmyAREM | 0:a89fe490343e | 27 | void updateAndWriteScore(char n1, char n2, char n3) |
JimmyAREM | 0:a89fe490343e | 28 | { |
JimmyAREM | 0:a89fe490343e | 29 | bufferScore[0] = n1; |
JimmyAREM | 0:a89fe490343e | 30 | bufferScore[1] = n2; |
JimmyAREM | 0:a89fe490343e | 31 | bufferScore[2] = n3; |
JimmyAREM | 0:a89fe490343e | 32 | write(bufferScore); |
JimmyAREM | 0:a89fe490343e | 33 | } |
JimmyAREM | 0:a89fe490343e | 34 | |
JimmyAREM | 0:a89fe490343e | 35 | void LectureI2CCarteCapteur(deplacement robot) |
JimmyAREM | 0:a89fe490343e | 36 | { |
JimmyAREM | 0:a89fe490343e | 37 | traitementBufferCapteurs(); |
JimmyAREM | 7:392aa81893eb | 38 | if(AnalyseDistance(distanceUltrasonGauche, distanceUltrasonDroit, distanceUltrasonArriere, typeMovement) == ROBOT) { |
JimmyAREM | 7:392aa81893eb | 39 | if( ((distanceUltrasonGauche <= 300) || (distanceUltrasonDroit <= 300)) && (typeMovement == DEPLACEMENT_AVANT) ) { |
JimmyAREM | 7:392aa81893eb | 40 | stopCapteurs = true; |
JimmyAREM | 7:392aa81893eb | 41 | } else if ( (distanceUltrasonArriere <= 300) && (typeMovement == DEPLACEMENT_ARRIERE) ) { |
JimmyAREM | 7:392aa81893eb | 42 | stopCapteurs = true; |
JimmyAREM | 7:392aa81893eb | 43 | } else { |
JimmyAREM | 7:392aa81893eb | 44 | stopCapteurs = false; |
JimmyAREM | 7:392aa81893eb | 45 | } |
JimmyAREM | 7:392aa81893eb | 46 | } else { |
JimmyAREM | 7:392aa81893eb | 47 | stopCapteurs = false; |
JimmyAREM | 0:a89fe490343e | 48 | } |
JimmyAREM | 0:a89fe490343e | 49 | } |
JimmyAREM | 0:a89fe490343e | 50 | |
JimmyAREM | 1:785b37686185 | 51 | void arretSystem() |
JimmyAREM | 1:785b37686185 | 52 | { |
JimmyAREM | 7:392aa81893eb | 53 | |
JimmyAREM | 1:785b37686185 | 54 | deplacement robot; |
JimmyAREM | 7:392aa81893eb | 55 | |
JimmyAREM | 1:785b37686185 | 56 | robot.initialisation(); |
JimmyAREM | 1:785b37686185 | 57 | robot.arreterRobot(); |
JimmyAREM | 1:785b37686185 | 58 | } |
JimmyAREM | 1:785b37686185 | 59 | |
JimmyAREM | 2:e0402d1e9ed5 | 60 | /*---------Debut Strategie homologation violet ------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 61 | |
JimmyAREM | 2:e0402d1e9ed5 | 62 | |
JimmyAREM | 7:392aa81893eb | 63 | void strategieHomologationViolet(deplacement robot, Demarreur demarreur) |
JimmyAREM | 1:785b37686185 | 64 | { |
JimmyAREM | 1:785b37686185 | 65 | write(bufferScore); |
JimmyAREM | 1:785b37686185 | 66 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 1:785b37686185 | 67 | int etapeMatch = 0; |
JimmyAREM | 7:392aa81893eb | 68 | while(demarreur.getState() == false) { |
JimmyAREM | 1:785b37686185 | 69 | //on attend |
JimmyAREM | 1:785b37686185 | 70 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 1:785b37686185 | 71 | } |
JimmyAREM | 1:785b37686185 | 72 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 7:392aa81893eb | 73 | initViolet(); |
JimmyAREM | 3:4810f8316e38 | 74 | robot.initialisation(); |
JimmyAREM | 1:785b37686185 | 75 | lancerTimerEcran(); |
JimmyAREM | 1:785b37686185 | 76 | tempsMatch.start(); |
JimmyAREM | 1:785b37686185 | 77 | typeEvitement = ARRET; |
JimmyAREM | 7:392aa81893eb | 78 | while(tempsMatch <= TEMPSMATCH) { |
JimmyAREM | 7:392aa81893eb | 79 | if(finActions == true) |
JimmyAREM | 7:392aa81893eb | 80 | { |
JimmyAREM | 7:392aa81893eb | 81 | etapeMatch++; |
JimmyAREM | 7:392aa81893eb | 82 | finActions = false; |
JimmyAREM | 7:392aa81893eb | 83 | } |
JimmyAREM | 1:785b37686185 | 84 | switch (etapeMatch) { |
JimmyAREM | 1:785b37686185 | 85 | |
JimmyAREM | 7:392aa81893eb | 86 | case 0 : { /* On tourne pour aller vers le terrain adverse et on avance jusqu'au milieu du terrain */ |
JimmyAREM | 7:392aa81893eb | 87 | |
JimmyAREM | 1:785b37686185 | 88 | typeMovement = DEPLACEMENT_AVANT; |
GuillaumeCH | 6:db41c3f7245e | 89 | robot.ligne_droite_basique(3000); |
JimmyAREM | 1:785b37686185 | 90 | robot.rotation_rel(90); |
GuillaumeCH | 6:db41c3f7245e | 91 | //robot.ligne_droite_basique(127500); |
JimmyAREM | 1:785b37686185 | 92 | etapeMatch++; |
JimmyAREM | 7:392aa81893eb | 93 | |
JimmyAREM | 7:392aa81893eb | 94 | break; |
JimmyAREM | 7:392aa81893eb | 95 | |
JimmyAREM | 7:392aa81893eb | 96 | default: { |
JimmyAREM | 7:392aa81893eb | 97 | robot.vitesse_nulle_D(0); |
JimmyAREM | 7:392aa81893eb | 98 | robot.vitesse_nulle_G(0); |
JimmyAREM | 7:392aa81893eb | 99 | motors_stop(); |
JimmyAREM | 7:392aa81893eb | 100 | } |
JimmyAREM | 1:785b37686185 | 101 | } |
JimmyAREM | 7:392aa81893eb | 102 | } |
JimmyAREM | 7:392aa81893eb | 103 | |
JimmyAREM | 7:392aa81893eb | 104 | //Arrêter les moteurs |
JimmyAREM | 7:392aa81893eb | 105 | robot.vitesse_nulle_D(0); |
JimmyAREM | 7:392aa81893eb | 106 | robot.vitesse_nulle_G(0); |
JimmyAREM | 7:392aa81893eb | 107 | motors_stop(); |
JimmyAREM | 7:392aa81893eb | 108 | while(1); |
JimmyAREM | 1:785b37686185 | 109 | } |
JimmyAREM | 1:785b37686185 | 110 | } |
JimmyAREM | 2:e0402d1e9ed5 | 111 | /*-------Fin Stratégie homologation violet------------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 112 | |
JimmyAREM | 2:e0402d1e9ed5 | 113 | |
JimmyAREM | 2:e0402d1e9ed5 | 114 | /*-------Debut Strategie homologation jaune-----------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 115 | |
JimmyAREM | 4:7a9a9720e4d0 | 116 | |
JimmyAREM | 7:392aa81893eb | 117 | void strategieHomologationJaune(deplacement robot, Demarreur demarreur) |
JimmyAREM | 2:e0402d1e9ed5 | 118 | { |
JimmyAREM | 2:e0402d1e9ed5 | 119 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 120 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 121 | int etapeMatch = 0; |
JimmyAREM | 7:392aa81893eb | 122 | while(demarreur.getState() == false) { |
JimmyAREM | 2:e0402d1e9ed5 | 123 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 124 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 125 | } |
JimmyAREM | 2:e0402d1e9ed5 | 126 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 7:392aa81893eb | 127 | initJaune(); |
JimmyAREM | 3:4810f8316e38 | 128 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 129 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 130 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 131 | typeEvitement = ARRET; |
JimmyAREM | 7:392aa81893eb | 132 | while(tempsMatch <= TEMPSMATCH) { |
JimmyAREM | 4:7a9a9720e4d0 | 133 | switch (etapeMatch) { |
GuillaumeCH | 6:db41c3f7245e | 134 | |
JimmyAREM | 7:392aa81893eb | 135 | case 0 : { /* On tourne pour aller vers le terrain adverse et on avance jusqu'au milieu du terrain */ |
GuillaumeCH | 6:db41c3f7245e | 136 | typeMovement = DEPLACEMENT_AVANT; |
GuillaumeCH | 6:db41c3f7245e | 137 | robot.ligne_droite_basique(3000); |
GuillaumeCH | 6:db41c3f7245e | 138 | robot.rotation_rel(-90); |
GuillaumeCH | 6:db41c3f7245e | 139 | //robot.ligne_droite_basique(127500); |
GuillaumeCH | 6:db41c3f7245e | 140 | etapeMatch++; |
JimmyAREM | 7:392aa81893eb | 141 | |
JimmyAREM | 7:392aa81893eb | 142 | break; |
GuillaumeCH | 6:db41c3f7245e | 143 | } |
JimmyAREM | 7:392aa81893eb | 144 | default: { |
GuillaumeCH | 6:db41c3f7245e | 145 | robot.vitesse_nulle_D(0); |
GuillaumeCH | 6:db41c3f7245e | 146 | robot.vitesse_nulle_G(0); |
GuillaumeCH | 6:db41c3f7245e | 147 | motors_stop(); |
GuillaumeCH | 6:db41c3f7245e | 148 | } |
JimmyAREM | 7:392aa81893eb | 149 | } |
GuillaumeCH | 6:db41c3f7245e | 150 | } |
JimmyAREM | 7:392aa81893eb | 151 | |
GuillaumeCH | 6:db41c3f7245e | 152 | //Arrêter les moteurs |
GuillaumeCH | 6:db41c3f7245e | 153 | robot.vitesse_nulle_D(0); |
GuillaumeCH | 6:db41c3f7245e | 154 | robot.vitesse_nulle_G(0); |
GuillaumeCH | 6:db41c3f7245e | 155 | motors_stop(); |
GuillaumeCH | 6:db41c3f7245e | 156 | while(1); |
JimmyAREM | 2:e0402d1e9ed5 | 157 | } |
JimmyAREM | 2:e0402d1e9ed5 | 158 | |
JimmyAREM | 2:e0402d1e9ed5 | 159 | /*Fin Strategie homologation jaune -------------------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 160 | |
JimmyAREM | 2:e0402d1e9ed5 | 161 | |
JimmyAREM | 2:e0402d1e9ed5 | 162 | /*Debut Strategie classique violet -------------------------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 163 | |
JimmyAREM | 2:e0402d1e9ed5 | 164 | |
JimmyAREM | 7:392aa81893eb | 165 | void strategieClassiqueViolet(deplacement robot, Demarreur demarreur) |
JimmyAREM | 0:a89fe490343e | 166 | { |
JimmyAREM | 0:a89fe490343e | 167 | write(bufferScore); |
JimmyAREM | 0:a89fe490343e | 168 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 0:a89fe490343e | 169 | int etapeMatch = 0; |
JimmyAREM | 7:392aa81893eb | 170 | while(demarreur.getState() == false) { |
JimmyAREM | 0:a89fe490343e | 171 | //on attend |
JimmyAREM | 0:a89fe490343e | 172 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 0:a89fe490343e | 173 | } |
JimmyAREM | 1:785b37686185 | 174 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 7:392aa81893eb | 175 | initViolet(); |
JimmyAREM | 4:7a9a9720e4d0 | 176 | robot.initialisation();//check si modif |
JimmyAREM | 0:a89fe490343e | 177 | lancerTimerEcran(); |
JimmyAREM | 0:a89fe490343e | 178 | tempsMatch.start(); |
JimmyAREM | 5:aa69d0e17c4e | 179 | typeEvitement = ARRET; |
JimmyAREM | 7:392aa81893eb | 180 | while(tempsMatch <= TEMPSMATCH) { |
JimmyAREM | 0:a89fe490343e | 181 | switch (etapeMatch) { |
JimmyAREM | 0:a89fe490343e | 182 | |
JimmyAREM | 7:392aa81893eb | 183 | case 0 : { /* On active l'expérience */ |
JimmyAREM | 0:a89fe490343e | 184 | typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 2:e0402d1e9ed5 | 185 | robot.ligne_droite_basique(26500); |
JimmyAREM | 0:a89fe490343e | 186 | robot.poussette(300); |
JimmyAREM | 0:a89fe490343e | 187 | updateAndWriteScore('0', '4', '0'); |
JimmyAREM | 0:a89fe490343e | 188 | etapeMatch++; |
JimmyAREM | 7:392aa81893eb | 189 | |
JimmyAREM | 7:392aa81893eb | 190 | break; |
JimmyAREM | 0:a89fe490343e | 191 | } |
JimmyAREM | 7:392aa81893eb | 192 | default: { |
JimmyAREM | 0:a89fe490343e | 193 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 194 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 195 | motors_stop(); |
JimmyAREM | 0:a89fe490343e | 196 | } |
JimmyAREM | 7:392aa81893eb | 197 | } |
JimmyAREM | 0:a89fe490343e | 198 | } |
JimmyAREM | 7:392aa81893eb | 199 | |
JimmyAREM | 0:a89fe490343e | 200 | //Arrêter les moteurs |
JimmyAREM | 0:a89fe490343e | 201 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 202 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 203 | motors_stop(); |
JimmyAREM | 0:a89fe490343e | 204 | while(1); |
JimmyAREM | 0:a89fe490343e | 205 | } |
JimmyAREM | 0:a89fe490343e | 206 | |
JimmyAREM | 0:a89fe490343e | 207 | |
JimmyAREM | 2:e0402d1e9ed5 | 208 | /*-------- Fin Strategie classique violet -----------------------------------------------*/ |
JimmyAREM | 0:a89fe490343e | 209 | |
JimmyAREM | 0:a89fe490343e | 210 | |
JimmyAREM | 2:e0402d1e9ed5 | 211 | /*------- Debut Strategie classique Jaune -----------------------------------------------*/ |
JimmyAREM | 0:a89fe490343e | 212 | |
JimmyAREM | 0:a89fe490343e | 213 | |
JimmyAREM | 7:392aa81893eb | 214 | void strategieClassiqueJaune(deplacement robot, Demarreur demarreur) |
JimmyAREM | 0:a89fe490343e | 215 | { |
JimmyAREM | 0:a89fe490343e | 216 | write(bufferScore); |
JimmyAREM | 0:a89fe490343e | 217 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 218 | int etapeMatch = 0; |
JimmyAREM | 7:392aa81893eb | 219 | while(demarreur.getState() == false) { |
JimmyAREM | 0:a89fe490343e | 220 | //on attend |
JimmyAREM | 0:a89fe490343e | 221 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 0:a89fe490343e | 222 | } |
JimmyAREM | 1:785b37686185 | 223 | tempsArretMvt.attach(&arretSystem, 100.0); |
JimmyAREM | 7:392aa81893eb | 224 | initJaune(); |
JimmyAREM | 3:4810f8316e38 | 225 | robot.initialisation(); |
JimmyAREM | 0:a89fe490343e | 226 | lancerTimerEcran(); |
JimmyAREM | 0:a89fe490343e | 227 | tempsMatch.start(); |
JimmyAREM | 5:aa69d0e17c4e | 228 | typeEvitement = ARRET; |
JimmyAREM | 7:392aa81893eb | 229 | while(tempsMatch <= TEMPSMATCH) { |
JimmyAREM | 0:a89fe490343e | 230 | switch (etapeMatch) { |
JimmyAREM | 0:a89fe490343e | 231 | |
JimmyAREM | 7:392aa81893eb | 232 | case 0 : { /* On active l'expérience */ |
JimmyAREM | 4:7a9a9720e4d0 | 233 | typeMovement = DEPLACEMENT_AVANT; |
JimmyAREM | 4:7a9a9720e4d0 | 234 | robot.ligne_droite_basique(26500); |
JimmyAREM | 0:a89fe490343e | 235 | robot.poussette(300); |
JimmyAREM | 0:a89fe490343e | 236 | updateAndWriteScore('0', '4', '0'); |
JimmyAREM | 0:a89fe490343e | 237 | etapeMatch++; |
JimmyAREM | 7:392aa81893eb | 238 | |
JimmyAREM | 7:392aa81893eb | 239 | break; |
JimmyAREM | 0:a89fe490343e | 240 | } |
JimmyAREM | 7:392aa81893eb | 241 | default: { |
JimmyAREM | 0:a89fe490343e | 242 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 243 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 244 | motors_stop(); |
JimmyAREM | 0:a89fe490343e | 245 | } |
JimmyAREM | 7:392aa81893eb | 246 | } |
JimmyAREM | 0:a89fe490343e | 247 | } |
JimmyAREM | 7:392aa81893eb | 248 | |
JimmyAREM | 0:a89fe490343e | 249 | //Arrêter les moteurs |
JimmyAREM | 0:a89fe490343e | 250 | robot.vitesse_nulle_D(0); |
JimmyAREM | 0:a89fe490343e | 251 | robot.vitesse_nulle_G(0); |
JimmyAREM | 0:a89fe490343e | 252 | motors_stop(); |
JimmyAREM | 0:a89fe490343e | 253 | while(1); |
JimmyAREM | 2:e0402d1e9ed5 | 254 | } |
JimmyAREM | 2:e0402d1e9ed5 | 255 | |
JimmyAREM | 2:e0402d1e9ed5 | 256 | /*--------- Fin Strategie classique jaune --------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 257 | |
JimmyAREM | 2:e0402d1e9ed5 | 258 | |
JimmyAREM | 2:e0402d1e9ed5 | 259 | /*--------- Debut Strategie RCVA violet ----------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 260 | |
JimmyAREM | 2:e0402d1e9ed5 | 261 | |
JimmyAREM | 7:392aa81893eb | 262 | void strategieRCVAViolet(deplacement robot, Demarreur demarreur) |
JimmyAREM | 2:e0402d1e9ed5 | 263 | { |
JimmyAREM | 2:e0402d1e9ed5 | 264 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 265 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 266 | int etapeMatch = 0; |
JimmyAREM | 7:392aa81893eb | 267 | while(demarreur.getState() == false) { |
JimmyAREM | 2:e0402d1e9ed5 | 268 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 269 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 270 | } |
JimmyAREM | 2:e0402d1e9ed5 | 271 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 7:392aa81893eb | 272 | initViolet(); |
JimmyAREM | 3:4810f8316e38 | 273 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 274 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 275 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 276 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 277 | } |
JimmyAREM | 2:e0402d1e9ed5 | 278 | |
JimmyAREM | 2:e0402d1e9ed5 | 279 | |
JimmyAREM | 2:e0402d1e9ed5 | 280 | /*-------- Fin Strategie RCVA violet -----------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 281 | |
JimmyAREM | 2:e0402d1e9ed5 | 282 | |
JimmyAREM | 2:e0402d1e9ed5 | 283 | /*-------- Debut Strategie RCVA jaune -----------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 284 | |
JimmyAREM | 7:392aa81893eb | 285 | void strategieRCVAJaune(deplacement robot, Demarreur demarreur) |
JimmyAREM | 2:e0402d1e9ed5 | 286 | { |
JimmyAREM | 2:e0402d1e9ed5 | 287 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 288 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 289 | int etapeMatch = 0; |
JimmyAREM | 7:392aa81893eb | 290 | while(demarreur.getState() == false) { |
JimmyAREM | 2:e0402d1e9ed5 | 291 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 292 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 293 | } |
JimmyAREM | 2:e0402d1e9ed5 | 294 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 7:392aa81893eb | 295 | initJaune(); |
JimmyAREM | 3:4810f8316e38 | 296 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 297 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 298 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 299 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 300 | } |
JimmyAREM | 2:e0402d1e9ed5 | 301 | |
JimmyAREM | 2:e0402d1e9ed5 | 302 | |
JimmyAREM | 2:e0402d1e9ed5 | 303 | /*-------- Fin Strategie RCVA jaune --------------------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 304 | |
JimmyAREM | 2:e0402d1e9ed5 | 305 | /*-------- Debut Strategie humiliation violet ---------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 306 | |
JimmyAREM | 7:392aa81893eb | 307 | void strategieHumiliationViolet(deplacement robot, Demarreur demarreur) |
JimmyAREM | 2:e0402d1e9ed5 | 308 | { |
JimmyAREM | 2:e0402d1e9ed5 | 309 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 310 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 311 | int etapeMatch = 0; |
JimmyAREM | 7:392aa81893eb | 312 | while(demarreur.getState() == false) { |
JimmyAREM | 2:e0402d1e9ed5 | 313 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 314 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 315 | } |
JimmyAREM | 2:e0402d1e9ed5 | 316 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 7:392aa81893eb | 317 | initViolet(); |
JimmyAREM | 3:4810f8316e38 | 318 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 319 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 320 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 321 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 322 | } |
JimmyAREM | 2:e0402d1e9ed5 | 323 | |
JimmyAREM | 2:e0402d1e9ed5 | 324 | |
JimmyAREM | 2:e0402d1e9ed5 | 325 | /*--------- Fin Strategie humiliation violet ----------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 326 | |
JimmyAREM | 2:e0402d1e9ed5 | 327 | |
JimmyAREM | 2:e0402d1e9ed5 | 328 | /*-------- Debut Strategie humiliation jaune ----------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 329 | |
JimmyAREM | 7:392aa81893eb | 330 | void strategieHumiliationJaune(deplacement robot, Demarreur demarreur) |
JimmyAREM | 2:e0402d1e9ed5 | 331 | { |
JimmyAREM | 2:e0402d1e9ed5 | 332 | write(bufferScore); |
JimmyAREM | 2:e0402d1e9ed5 | 333 | Timer tempsMatch; // timer en seconde |
JimmyAREM | 2:e0402d1e9ed5 | 334 | int etapeMatch = 0; |
JimmyAREM | 7:392aa81893eb | 335 | while(demarreur.getState() == false) { |
JimmyAREM | 2:e0402d1e9ed5 | 336 | //on attend |
JimmyAREM | 2:e0402d1e9ed5 | 337 | //pc.printf("On attend le depart du Robot Thanos\n\r"); |
JimmyAREM | 2:e0402d1e9ed5 | 338 | } |
JimmyAREM | 2:e0402d1e9ed5 | 339 | tempsArretMvt.attach(&arretSystem, TEMPSMATCH); |
JimmyAREM | 7:392aa81893eb | 340 | initJaune(); |
JimmyAREM | 3:4810f8316e38 | 341 | robot.initialisation(); |
JimmyAREM | 2:e0402d1e9ed5 | 342 | lancerTimerEcran(); |
JimmyAREM | 2:e0402d1e9ed5 | 343 | tempsMatch.start(); |
JimmyAREM | 2:e0402d1e9ed5 | 344 | typeEvitement = ARRET; |
JimmyAREM | 2:e0402d1e9ed5 | 345 | } |
JimmyAREM | 2:e0402d1e9ed5 | 346 | |
JimmyAREM | 2:e0402d1e9ed5 | 347 | |
JimmyAREM | 2:e0402d1e9ed5 | 348 | /*--------- Fin Strategie humiliation jaune -----------------------------------------*/ |
JimmyAREM | 2:e0402d1e9ed5 | 349 | |
JimmyAREM | 2:e0402d1e9ed5 | 350 | |
JimmyAREM | 2:e0402d1e9ed5 | 351 | |
JimmyAREM | 2:e0402d1e9ed5 | 352 |