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