code avec modifs, programme mit dans les robots pour les derniers matchs

Dependencies:   mbed SerialHalfDuplex SDFileSystem liaison_Bluetooth ident_crac DISCO-F469NI_portrait

Committer:
slowness
Date:
Wed Mar 17 08:13:52 2021 +0000
Revision:
29:ff575aff301f
Parent:
28:7f2990747e09
Child:
32:7f8e3ee2adac
version correction de la sd

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gabrieltetar 21:d137ec53c3a9 1 #include "global.h"
gabrieltetar 21:d137ec53c3a9 2
gabrieltetar 21:d137ec53c3a9 3 #define VERT 0xFF00FF00
gabrieltetar 21:d137ec53c3a9 4 #define ROUGE 0xFFFF0000
gabrieltetar 21:d137ec53c3a9 5 #define BLEU 0xFF0000FF
gabrieltetar 21:d137ec53c3a9 6 #define JAUNE 0xFFFDD835//FEFE00
gabrieltetar 21:d137ec53c3a9 7 #define BLANC 0xFF000000
gabrieltetar 21:d137ec53c3a9 8 #define ORANGE 0xFFFFA500
gabrieltetar 21:d137ec53c3a9 9 #define NOIR 0xFF000000
gabrieltetar 21:d137ec53c3a9 10 #define DIY_GREY 0xFFDFDFDF
gabrieltetar 21:d137ec53c3a9 11 #define VIOLET 0xFF4527A0
gabrieltetar 27:ff70537a7619 12 #define VERT_F 0xFF00C400
gabrieltetar 21:d137ec53c3a9 13 TS_DISCO_F469NI ts;
gabrieltetar 21:d137ec53c3a9 14 LCD_DISCO_F469NI lcd;
gabrieltetar 21:d137ec53c3a9 15
gabrieltetar 21:d137ec53c3a9 16
gabrieltetar 21:d137ec53c3a9 17 TS_StateTypeDef TS_State;
gabrieltetar 21:d137ec53c3a9 18
gabrieltetar 21:d137ec53c3a9 19
gabrieltetar 21:d137ec53c3a9 20 /////////////////DEFINITION DES BOUTONS////////////////////
gabrieltetar 21:d137ec53c3a9 21 Button COTE_JAUNE(0, 25, 400, 300, "JAUNE");
gabrieltetar 21:d137ec53c3a9 22 Button COTE_VIOLET(0, 350, 400, 300, "VIOLET");
gabrieltetar 21:d137ec53c3a9 23 Button RETOUR (0, 680, 400, 110, "--Precedent--");
gabrieltetar 21:d137ec53c3a9 24 Button LANCER (0, 200, 400, 200, "--LANCER--");
gabrieltetar 21:d137ec53c3a9 25 Button CHECK (0, 420, 400, 200, "Valider");
gabrieltetar 21:d137ec53c3a9 26 Button MATCH (0, 50, 400, 320, "Match");
gabrieltetar 21:d137ec53c3a9 27 Button DEMONSTRATION (0, 400, 400, 320, "Demo");
gabrieltetar 21:d137ec53c3a9 28 //menu demo
gabrieltetar 21:d137ec53c3a9 29 Button TEST_VENT(0, 25, 400, 100, "Test ventouses");
gabrieltetar 21:d137ec53c3a9 30 Button TEST_MOT(0, 135, 400, 100, "Test moteur");
gabrieltetar 21:d137ec53c3a9 31 Button TEST_COUL(0,245,400,100,"Test capteurs couleur");
gabrieltetar 21:d137ec53c3a9 32 Button TEST_BRAS(0,355,400,100,"Test Bras");
gabrieltetar 21:d137ec53c3a9 33 Button TEST_AUDIO(0,465,400,100,"Test Audio");
gabrieltetar 22:c7763a7ec6c7 34
gabrieltetar 22:c7763a7ec6c7 35 Button TEST_NEXT(0,575,400,100,"------>");
gabrieltetar 22:c7763a7ec6c7 36 Button TEST_DIV(0,25,400,100,"Test Divers");
gabrieltetar 22:c7763a7ec6c7 37 Button TEST_ASSERV(0, 135, 400, 100, "Test asserv");
gabrieltetar 21:d137ec53c3a9 38 //menu demo/demo/
gabrieltetar 21:d137ec53c3a9 39 Button TEST_A(0,25,195,100,"A");
gabrieltetar 21:d137ec53c3a9 40 Button TEST_B(205,25,195,100,"B");
gabrieltetar 21:d137ec53c3a9 41 Button TEST_C(0,135,195,100,"C");
gabrieltetar 21:d137ec53c3a9 42 Button TEST_D(205,135,195,100,"D");
gabrieltetar 22:c7763a7ec6c7 43 Button TEST_NUM(0,245,400,100,"Num");
gabrieltetar 21:d137ec53c3a9 44 Button TEST_PLUS(205,355,195,100,"+");
gabrieltetar 21:d137ec53c3a9 45 Button TEST_MOINS(0,355,195,100,"-");
gabrieltetar 22:c7763a7ec6c7 46 Button FORCE_LAUNCH(0, 600, 400, 100, "Force Launch");
gabrieltetar 21:d137ec53c3a9 47 Button SUIVANT(0,380,200,100,"Suivant");
gabrieltetar 21:d137ec53c3a9 48 ////////////////////////////////////////////////////////////
gabrieltetar 24:1a13c998c7ac 49
gabrieltetar 21:d137ec53c3a9 50 signed char Bouton_Strat (void);
gabrieltetar 27:ff70537a7619 51 void DrawC (int l,int h,int x, int y, unsigned char fill);
gabrieltetar 27:ff70537a7619 52 void DrawR (int l,int h,int x, int y, unsigned char fill);
gabrieltetar 27:ff70537a7619 53 void DrawA (int l,int h,int x, int y, unsigned char fill);
gabrieltetar 24:1a13c998c7ac 54
gabrieltetar 21:d137ec53c3a9 55 void SelectionStrat (unsigned char numeroStrat);
gabrieltetar 21:d137ec53c3a9 56
gabrieltetar 21:d137ec53c3a9 57 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 58 /* FUNCTION NAME: automate_etat_ihm */
gabrieltetar 21:d137ec53c3a9 59 /* DESCRIPTION : Automate de gestion de l'affichage */
gabrieltetar 21:d137ec53c3a9 60 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 61 void automate_etat_ihm(void)
gabrieltetar 21:d137ec53c3a9 62 {
gabrieltetar 21:d137ec53c3a9 63 char toto[2];
gabrieltetar 21:d137ec53c3a9 64 int j;
gabrieltetar 21:d137ec53c3a9 65 unsigned char maximilien=1;
gabrieltetar 21:d137ec53c3a9 66 if (j==0) {
gabrieltetar 21:d137ec53c3a9 67 ts.Init(lcd.GetXSize(), lcd.GetYSize());
gabrieltetar 21:d137ec53c3a9 68 j++;
gabrieltetar 21:d137ec53c3a9 69 }
gabrieltetar 21:d137ec53c3a9 70 ts.GetState(&TS_State);
gabrieltetar 21:d137ec53c3a9 71 switch (strat_etat_s) {
gabrieltetar 24:1a13c998c7ac 72 case INIT : //intialise l'écran et passe à l'attente d'initialisation des cartes
gabrieltetar 21:d137ec53c3a9 73 ts.GetState(&TS_State);
gabrieltetar 22:c7763a7ec6c7 74 canProcessRx();
gabrieltetar 24:1a13c998c7ac 75 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 76 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 24:1a13c998c7ac 77 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 78 wait(0.15);
gabrieltetar 27:ff70537a7619 79 DrawC(95,150,0,50,0);
gabrieltetar 27:ff70537a7619 80 DrawR(95,150,105,50,0);
gabrieltetar 27:ff70537a7619 81 DrawA(95,150,210,50,0);
gabrieltetar 27:ff70537a7619 82 DrawC(95,150,315,50,0);
gabrieltetar 27:ff70537a7619 83 DrawCheck(30,30,50,243,0);
gabrieltetar 27:ff70537a7619 84 DrawCheck(30,30,50,293,0);
gabrieltetar 27:ff70537a7619 85 DrawCheck(30,30,50,343,0);
gabrieltetar 27:ff70537a7619 86 DrawCheck(30,30,50,393,0);
gabrieltetar 27:ff70537a7619 87 lcd.DisplayStringAt(100, 250, (uint8_t *)"Init CAN", LEFT_MODE);
slowness 29:ff575aff301f 88 DrawCheck(30,30,50,243,can_present);
gabrieltetar 27:ff70537a7619 89 lcd.DisplayStringAt(100, 300, (uint8_t *)"Micro SD", LEFT_MODE);
slowness 29:ff575aff301f 90 DrawCheck(30,30,50,293,sd_present);
gabrieltetar 27:ff70537a7619 91 lcd.DisplayStringAt(100, 350, (uint8_t *)"Carte Moteur", LEFT_MODE);
gabrieltetar 27:ff70537a7619 92 lcd.DisplayStringAt(100, 400, (uint8_t *)"Balise IR", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 93 FORCE_LAUNCH.Draw(0xFFFF0000, 0);
gabrieltetar 24:1a13c998c7ac 94
gabrieltetar 24:1a13c998c7ac 95 strat_etat_s=ATT;
gabrieltetar 24:1a13c998c7ac 96 break;
gabrieltetar 24:1a13c998c7ac 97
gabrieltetar 24:1a13c998c7ac 98 case ATT : //Si les cartes sont présentes passe directement à choix sinon attente de force Launch (cette partie est encore buggée mais les cartes affichent bien leur présence donc faut juste force launch tout le temps...)
gabrieltetar 24:1a13c998c7ac 99 if (flag_check_carte==1) {
gabrieltetar 24:1a13c998c7ac 100 strat_etat_s = CHOIX;
gabrieltetar 24:1a13c998c7ac 101 gameEtat = ETAT_CONFIG;
gabrieltetar 24:1a13c998c7ac 102 } else if (FORCE_LAUNCH.Touched()) {
gabrieltetar 24:1a13c998c7ac 103 strat_etat_s = CHOIX;
gabrieltetar 24:1a13c998c7ac 104 gameEtat = ETAT_CONFIG;
gabrieltetar 24:1a13c998c7ac 105 while(FORCE_LAUNCH.Touched());
gabrieltetar 21:d137ec53c3a9 106 }
gabrieltetar 24:1a13c998c7ac 107
gabrieltetar 21:d137ec53c3a9 108 break;
gabrieltetar 24:1a13c998c7ac 109
gabrieltetar 24:1a13c998c7ac 110
gabrieltetar 21:d137ec53c3a9 111 case CHOIX : //Match ou DEMO
gabrieltetar 21:d137ec53c3a9 112 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 113 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 114 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 115 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Match ou demonstration ?", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 116 DEMONSTRATION.Draw(LCD_COLOR_LIGHTGREEN, 0);
gabrieltetar 21:d137ec53c3a9 117 MATCH.Draw(0xFFF01010, 0);
gabrieltetar 21:d137ec53c3a9 118 while(strat_etat_s == CHOIX) {
gabrieltetar 21:d137ec53c3a9 119 canProcessRx();
gabrieltetar 21:d137ec53c3a9 120 if(DEMONSTRATION.Touched()) {
gabrieltetar 21:d137ec53c3a9 121 strat_etat_s = DEMO;
gabrieltetar 21:d137ec53c3a9 122 while(DEMONSTRATION.Touched());
gabrieltetar 21:d137ec53c3a9 123 }
gabrieltetar 21:d137ec53c3a9 124
gabrieltetar 21:d137ec53c3a9 125 if(MATCH.Touched()) {
gabrieltetar 21:d137ec53c3a9 126 strat_etat_s = SELECT_SIDE;
gabrieltetar 21:d137ec53c3a9 127 while(MATCH.Touched());
gabrieltetar 21:d137ec53c3a9 128 }
gabrieltetar 21:d137ec53c3a9 129
gabrieltetar 21:d137ec53c3a9 130 }
gabrieltetar 21:d137ec53c3a9 131 break;
gabrieltetar 21:d137ec53c3a9 132
gabrieltetar 21:d137ec53c3a9 133 case DEMO :
gabrieltetar 21:d137ec53c3a9 134 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 135 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 136 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 22:c7763a7ec6c7 137 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"DEMO 1/2", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 138 RETOUR.Draw(0xFFFF0000, 0);
gabrieltetar 21:d137ec53c3a9 139 TEST_VENT.Draw(VERT, 0);
gabrieltetar 21:d137ec53c3a9 140 TEST_MOT.Draw(VERT, 0);
gabrieltetar 21:d137ec53c3a9 141 TEST_COUL.Draw(VERT, 0);
gabrieltetar 21:d137ec53c3a9 142 TEST_BRAS.Draw(VERT, 0);
gabrieltetar 21:d137ec53c3a9 143 TEST_AUDIO.Draw(VERT, 0);
gabrieltetar 22:c7763a7ec6c7 144 TEST_NEXT.Draw(BLEU, 0);
gabrieltetar 21:d137ec53c3a9 145 maximilien=0;
gabrieltetar 21:d137ec53c3a9 146 while (strat_etat_s == DEMO) {
gabrieltetar 21:d137ec53c3a9 147 canProcessRx();
gabrieltetar 21:d137ec53c3a9 148 if(TEST_VENT.Touched()) {
gabrieltetar 21:d137ec53c3a9 149 while(TEST_VENT.Touched());
gabrieltetar 21:d137ec53c3a9 150 strat_etat_s = TEST_VENTOUSE;
gabrieltetar 21:d137ec53c3a9 151 } else if(TEST_MOT.Touched()) {
gabrieltetar 21:d137ec53c3a9 152 while(TEST_MOT.Touched());
gabrieltetar 21:d137ec53c3a9 153 strat_etat_s = TEST_MOTEUR;
gabrieltetar 22:c7763a7ec6c7 154 } else if(TEST_NEXT.Touched()) {
gabrieltetar 22:c7763a7ec6c7 155 while(TEST_NEXT.Touched());
gabrieltetar 22:c7763a7ec6c7 156 strat_etat_s = DEMO2;
gabrieltetar 21:d137ec53c3a9 157 } else if (TEST_COUL.Touched()) {
gabrieltetar 21:d137ec53c3a9 158 while(TEST_COUL.Touched());
gabrieltetar 21:d137ec53c3a9 159 strat_etat_s =TEST_COULEUR ;
gabrieltetar 21:d137ec53c3a9 160 } else if (TEST_BRAS.Touched()) {
gabrieltetar 21:d137ec53c3a9 161 while(TEST_BRAS.Touched());
gabrieltetar 21:d137ec53c3a9 162 strat_etat_s =TEST_SERVO_BRAS ;
gabrieltetar 21:d137ec53c3a9 163 } else if(TEST_AUDIO.Touched()) {
gabrieltetar 21:d137ec53c3a9 164 while(TEST_AUDIO.Touched());
gabrieltetar 21:d137ec53c3a9 165 strat_etat_s=TEST_AUD;
gabrieltetar 21:d137ec53c3a9 166 } else if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 167 while(RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 168 strat_etat_s = CHOIX;
gabrieltetar 21:d137ec53c3a9 169 }
gabrieltetar 21:d137ec53c3a9 170 }
gabrieltetar 21:d137ec53c3a9 171 break;
gabrieltetar 24:1a13c998c7ac 172
gabrieltetar 24:1a13c998c7ac 173 case DEMO2 :
gabrieltetar 22:c7763a7ec6c7 174 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 22:c7763a7ec6c7 175 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 22:c7763a7ec6c7 176 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 22:c7763a7ec6c7 177 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"DEMO 2/2", LEFT_MODE);
gabrieltetar 22:c7763a7ec6c7 178 RETOUR.Draw(0xFFFF0000, 0);
gabrieltetar 22:c7763a7ec6c7 179 TEST_DIV.Draw(VERT, 0);
gabrieltetar 22:c7763a7ec6c7 180 TEST_ASSERV.Draw(VERT, 0);
gabrieltetar 22:c7763a7ec6c7 181 TEST_NEXT.Draw(BLEU, 0);
gabrieltetar 22:c7763a7ec6c7 182 maximilien=0;
gabrieltetar 22:c7763a7ec6c7 183 while (strat_etat_s == DEMO2) {
gabrieltetar 22:c7763a7ec6c7 184 canProcessRx();
gabrieltetar 22:c7763a7ec6c7 185 if(TEST_NEXT.Touched()) {
gabrieltetar 22:c7763a7ec6c7 186 while(TEST_NEXT.Touched());
gabrieltetar 22:c7763a7ec6c7 187 strat_etat_s = DEMO;
gabrieltetar 22:c7763a7ec6c7 188 } else if(TEST_DIV.Touched()) {
gabrieltetar 22:c7763a7ec6c7 189 while(TEST_DIV.Touched());
gabrieltetar 22:c7763a7ec6c7 190 strat_etat_s = TEST_DIVE;
gabrieltetar 22:c7763a7ec6c7 191 } else if(TEST_ASSERV.Touched()) {
gabrieltetar 22:c7763a7ec6c7 192 while(TEST_ASSERV.Touched());
gabrieltetar 22:c7763a7ec6c7 193 strat_etat_s = TEST_ASSERVE;
gabrieltetar 22:c7763a7ec6c7 194 } else if(RETOUR.Touched()) {
gabrieltetar 22:c7763a7ec6c7 195 while(RETOUR.Touched());
gabrieltetar 22:c7763a7ec6c7 196 strat_etat_s = CHOIX;
gabrieltetar 22:c7763a7ec6c7 197 }
gabrieltetar 22:c7763a7ec6c7 198 }
gabrieltetar 24:1a13c998c7ac 199 break;
gabrieltetar 24:1a13c998c7ac 200
gabrieltetar 24:1a13c998c7ac 201 case TEST_ASSERVE:
gabrieltetar 24:1a13c998c7ac 202 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 203 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 24:1a13c998c7ac 204 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 205 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Asservissements", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 206 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 24:1a13c998c7ac 207 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 208 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 209 while(strat_etat_s==TEST_ASSERVE) {
gabrieltetar 24:1a13c998c7ac 210 if(RETOUR.Touched()) {
gabrieltetar 24:1a13c998c7ac 211 while (RETOUR.Touched());
gabrieltetar 24:1a13c998c7ac 212 strat_etat_s=DEMO2;
gabrieltetar 24:1a13c998c7ac 213 } else if(TEST_A.Touched()) {
gabrieltetar 24:1a13c998c7ac 214 while (TEST_A.Touched());
gabrieltetar 24:1a13c998c7ac 215 GoToPosition(2000,0,0,0);
gabrieltetar 24:1a13c998c7ac 216 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 217 } else if(TEST_B.Touched()) {
gabrieltetar 24:1a13c998c7ac 218 while (TEST_B.Touched());
gabrieltetar 24:1a13c998c7ac 219 Rotate(3599);
gabrieltetar 24:1a13c998c7ac 220 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 221 }
gabrieltetar 24:1a13c998c7ac 222 }
gabrieltetar 24:1a13c998c7ac 223 break;
gabrieltetar 24:1a13c998c7ac 224
gabrieltetar 24:1a13c998c7ac 225 case TEST_DIVE:
gabrieltetar 24:1a13c998c7ac 226
gabrieltetar 24:1a13c998c7ac 227 while(strat_etat_s==TEST_DIVE) {
gabrieltetar 24:1a13c998c7ac 228 canProcessRx();
gabrieltetar 24:1a13c998c7ac 229 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 230 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 24:1a13c998c7ac 231 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 232 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Coordonnees", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 233 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 24:1a13c998c7ac 234 sprintf(toto,"%hd",x_robot);
gabrieltetar 24:1a13c998c7ac 235 lcd.DisplayStringAt(0, LINE(10), (unsigned char *)"X :", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 236 lcd.DisplayStringAt(50, LINE(10), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 237 sprintf(toto,"%hd",y_robot);
gabrieltetar 24:1a13c998c7ac 238 lcd.DisplayStringAt(0, LINE(11), (unsigned char *)"Y :", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 239 lcd.DisplayStringAt(50, LINE(11), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 240 sprintf(toto,"%hd",theta_robot);
gabrieltetar 24:1a13c998c7ac 241 lcd.DisplayStringAt(0, LINE(12), (unsigned char *)"T :", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 242 lcd.DisplayStringAt(50, LINE(12), (unsigned char *) toto, LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 243 if(RETOUR.Touched()) {
gabrieltetar 24:1a13c998c7ac 244 while (RETOUR.Touched());
gabrieltetar 24:1a13c998c7ac 245 strat_etat_s=DEMO2;
gabrieltetar 24:1a13c998c7ac 246 }
gabrieltetar 24:1a13c998c7ac 247 wait(0.2);
gabrieltetar 24:1a13c998c7ac 248 }
gabrieltetar 24:1a13c998c7ac 249 break;
gabrieltetar 21:d137ec53c3a9 250
gabrieltetar 21:d137ec53c3a9 251 case TEST_VENTOUSE:
gabrieltetar 21:d137ec53c3a9 252 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 253 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 254 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 255 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 256 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Ventouse", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 257 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 258 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 259 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 260 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 261 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 262 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 263 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 264 while(strat_etat_s==TEST_VENTOUSE) {
gabrieltetar 21:d137ec53c3a9 265 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 266 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 267 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 268 } else if(TEST_A.Touched()) {
gabrieltetar 21:d137ec53c3a9 269 while (TEST_A.Touched());
maximilienlv 28:7f2990747e09 270 SendRawId(VENT_ETAT);
gabrieltetar 21:d137ec53c3a9 271 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 272 } else if(TEST_NUM.Touched()) {
gabrieltetar 21:d137ec53c3a9 273 while (TEST_NUM.Touched());
gabrieltetar 21:d137ec53c3a9 274 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 275 switch(maximilien){
gabrieltetar 21:d137ec53c3a9 276 case 1:
gabrieltetar 21:d137ec53c3a9 277 SendRawId(TEST_VENT_1_ON);
gabrieltetar 21:d137ec53c3a9 278 break;
gabrieltetar 21:d137ec53c3a9 279 case 2:
gabrieltetar 21:d137ec53c3a9 280 SendRawId(TEST_VENT_1_OFF);
gabrieltetar 21:d137ec53c3a9 281 break;
gabrieltetar 21:d137ec53c3a9 282 case 3:
gabrieltetar 21:d137ec53c3a9 283 //SendRawId(TEST_VENT_3);
gabrieltetar 21:d137ec53c3a9 284 break;
gabrieltetar 21:d137ec53c3a9 285 case 4:
gabrieltetar 21:d137ec53c3a9 286 //SendRawId(TEST_VENT_4);
gabrieltetar 21:d137ec53c3a9 287 break;
gabrieltetar 21:d137ec53c3a9 288 case 5:
gabrieltetar 21:d137ec53c3a9 289 //SendRawId(TEST_VENT_5);
gabrieltetar 21:d137ec53c3a9 290 break;
gabrieltetar 21:d137ec53c3a9 291 case 6:
gabrieltetar 21:d137ec53c3a9 292 //SendRawId(TEST_VENT_6);
gabrieltetar 21:d137ec53c3a9 293 break;
gabrieltetar 21:d137ec53c3a9 294 }
gabrieltetar 21:d137ec53c3a9 295 } else if(TEST_PLUS.Touched()) {
gabrieltetar 21:d137ec53c3a9 296 while (TEST_PLUS.Touched());
gabrieltetar 21:d137ec53c3a9 297 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 298 if(maximilien!=6)maximilien++;
gabrieltetar 21:d137ec53c3a9 299 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 300 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 301 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 302 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 303 } else if(TEST_MOINS.Touched()) {
gabrieltetar 21:d137ec53c3a9 304 while (TEST_MOINS.Touched());
gabrieltetar 21:d137ec53c3a9 305 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 306 if(maximilien!=1)maximilien--;
gabrieltetar 21:d137ec53c3a9 307 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 308 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 309 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 310 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 311 }
gabrieltetar 21:d137ec53c3a9 312 }
gabrieltetar 21:d137ec53c3a9 313 break;
gabrieltetar 21:d137ec53c3a9 314
gabrieltetar 24:1a13c998c7ac 315 case TEST_ELECTROV:
gabrieltetar 21:d137ec53c3a9 316 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 317 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 318 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 319 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 320 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"A : Manches B : Pavillon", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 321 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 322 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 323 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 324 while(strat_etat_s==TEST_ELECTROV) {
gabrieltetar 21:d137ec53c3a9 325 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 326 while (RETOUR.Touched());
gabrieltetar 24:1a13c998c7ac 327 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 328 } else if(TEST_A.Touched()) {
gabrieltetar 21:d137ec53c3a9 329 while (TEST_A.Touched());
gabrieltetar 21:d137ec53c3a9 330 //SendRawId(TEST_ELECTROV_A);
gabrieltetar 21:d137ec53c3a9 331 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 332 } else if(TEST_B.Touched()) {
gabrieltetar 21:d137ec53c3a9 333 while (TEST_B.Touched());
gabrieltetar 21:d137ec53c3a9 334 //SendRawId(TEST_ELECTROV_A);
gabrieltetar 21:d137ec53c3a9 335 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 336 }
gabrieltetar 21:d137ec53c3a9 337 }
gabrieltetar 21:d137ec53c3a9 338 break;
gabrieltetar 24:1a13c998c7ac 339
gabrieltetar 21:d137ec53c3a9 340 case TEST_AUD:
gabrieltetar 21:d137ec53c3a9 341
gabrieltetar 21:d137ec53c3a9 342 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 343 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 344 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 345 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 346 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Audio", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 347 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 348 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 349 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 350 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 351 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 352 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 353 while(strat_etat_s==TEST_AUD) {
gabrieltetar 21:d137ec53c3a9 354 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 355 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 356 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 357 } else if(TEST_NUM.Touched()) {
gabrieltetar 21:d137ec53c3a9 358 while (TEST_NUM.Touched());
gabrieltetar 21:d137ec53c3a9 359 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 360 Debug_Audio(3,maximilien);
gabrieltetar 21:d137ec53c3a9 361 } else if(TEST_PLUS.Touched()) {
gabrieltetar 21:d137ec53c3a9 362 while (TEST_PLUS.Touched());
gabrieltetar 21:d137ec53c3a9 363 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 364 if(maximilien!=20)maximilien++;
gabrieltetar 21:d137ec53c3a9 365 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 366 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 367 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 368 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 369 } else if(TEST_MOINS.Touched()) {
gabrieltetar 21:d137ec53c3a9 370 while (TEST_MOINS.Touched());
gabrieltetar 21:d137ec53c3a9 371 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 372 if(maximilien!=1)maximilien--;
gabrieltetar 21:d137ec53c3a9 373 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 374 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 375 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 376 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 377 }
gabrieltetar 21:d137ec53c3a9 378 }
gabrieltetar 21:d137ec53c3a9 379 break;
gabrieltetar 21:d137ec53c3a9 380
gabrieltetar 21:d137ec53c3a9 381 case TEST_SERVO_BRAS:
gabrieltetar 21:d137ec53c3a9 382
gabrieltetar 21:d137ec53c3a9 383 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 384 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 385 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 386 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 387 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Bras", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 388 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 389 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 390 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 391 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 392 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 393 TEST_C.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 394 TEST_D.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 395 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 396 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 397 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 398 while(strat_etat_s==TEST_SERVO_BRAS) {
gabrieltetar 21:d137ec53c3a9 399 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 400 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 401 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 402 } else if(TEST_A.Touched()) {
gabrieltetar 21:d137ec53c3a9 403 while (TEST_A.Touched());
gabrieltetar 21:d137ec53c3a9 404 SendRawId(TEST_BRAS_A);
gabrieltetar 21:d137ec53c3a9 405 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 406 } else if(TEST_B.Touched()) {
gabrieltetar 21:d137ec53c3a9 407 while (TEST_B.Touched());
gabrieltetar 21:d137ec53c3a9 408 SendRawId(TEST_BRAS_B);
gabrieltetar 21:d137ec53c3a9 409 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 410 } else if(TEST_C.Touched()) {
gabrieltetar 21:d137ec53c3a9 411 while (TEST_C.Touched());
gabrieltetar 21:d137ec53c3a9 412 SendRawId(TEST_BRAS_C);
gabrieltetar 21:d137ec53c3a9 413 TEST_C.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 414 } else if(TEST_D.Touched()) {
gabrieltetar 21:d137ec53c3a9 415 while (TEST_D.Touched());
gabrieltetar 21:d137ec53c3a9 416 SendRawId(TEST_BRAS_D);
gabrieltetar 21:d137ec53c3a9 417 TEST_D.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 418 } else if(TEST_NUM.Touched()) {
gabrieltetar 21:d137ec53c3a9 419 while (TEST_NUM.Touched());
gabrieltetar 21:d137ec53c3a9 420 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 421 switch(maximilien){
gabrieltetar 21:d137ec53c3a9 422 case 1:
gabrieltetar 21:d137ec53c3a9 423 SendRawId(TEST_BRAS_1);
gabrieltetar 21:d137ec53c3a9 424 break;
gabrieltetar 21:d137ec53c3a9 425 case 2:
gabrieltetar 21:d137ec53c3a9 426 SendRawId(TEST_BRAS_2);
gabrieltetar 21:d137ec53c3a9 427 break;
gabrieltetar 21:d137ec53c3a9 428 case 3:
gabrieltetar 21:d137ec53c3a9 429 SendRawId(TEST_BRAS_3);
gabrieltetar 21:d137ec53c3a9 430 break;
gabrieltetar 21:d137ec53c3a9 431 case 4:
gabrieltetar 21:d137ec53c3a9 432 SendRawId(TEST_BRAS_4);
gabrieltetar 21:d137ec53c3a9 433 break;
gabrieltetar 21:d137ec53c3a9 434 case 5:
gabrieltetar 21:d137ec53c3a9 435 SendRawId(TEST_BRAS_5);
gabrieltetar 21:d137ec53c3a9 436 break;
gabrieltetar 21:d137ec53c3a9 437 case 6:
gabrieltetar 21:d137ec53c3a9 438 SendRawId(TEST_BRAS_6);
gabrieltetar 21:d137ec53c3a9 439 break;
gabrieltetar 21:d137ec53c3a9 440 }
gabrieltetar 21:d137ec53c3a9 441 } else if(TEST_PLUS.Touched()) {
gabrieltetar 21:d137ec53c3a9 442 while (TEST_PLUS.Touched());
gabrieltetar 21:d137ec53c3a9 443 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 444 if(maximilien!=6)maximilien++;
gabrieltetar 21:d137ec53c3a9 445 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 446 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 447 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 448 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 449 } else if(TEST_MOINS.Touched()) {
gabrieltetar 21:d137ec53c3a9 450 while (TEST_MOINS.Touched());
gabrieltetar 21:d137ec53c3a9 451 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 452 if(maximilien!=1)maximilien--;
gabrieltetar 21:d137ec53c3a9 453 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 454 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 455 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 456 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 457 }
gabrieltetar 21:d137ec53c3a9 458 }
gabrieltetar 21:d137ec53c3a9 459 break;
gabrieltetar 21:d137ec53c3a9 460
gabrieltetar 21:d137ec53c3a9 461 case TEST_COULEUR:
gabrieltetar 21:d137ec53c3a9 462 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 463 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Couleur", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 464 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 465 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 466 TEST_C.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 467 TEST_D.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 468 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 469 while(strat_etat_s==TEST_COULEUR) {
gabrieltetar 21:d137ec53c3a9 470 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 471 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 472 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 473 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 474 }else if(TEST_A.Touched()) {
gabrieltetar 24:1a13c998c7ac 475 while (TEST_A.Touched());
gabrieltetar 24:1a13c998c7ac 476 SendRawId(TEST_BRAS_A);
gabrieltetar 24:1a13c998c7ac 477 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 478 } else if(TEST_B.Touched()) {
gabrieltetar 24:1a13c998c7ac 479 while (TEST_B.Touched());
gabrieltetar 24:1a13c998c7ac 480 SendRawId(TEST_BRAS_B);
gabrieltetar 24:1a13c998c7ac 481 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 482 } else if(TEST_C.Touched()) {
gabrieltetar 24:1a13c998c7ac 483 while (TEST_C.Touched());
gabrieltetar 24:1a13c998c7ac 484 SendRawId(TEST_BRAS_C);
gabrieltetar 24:1a13c998c7ac 485 TEST_C.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 486 } else if(TEST_D.Touched()) {
gabrieltetar 24:1a13c998c7ac 487 while (TEST_D.Touched());
gabrieltetar 24:1a13c998c7ac 488 SendRawId(TEST_BRAS_D);
gabrieltetar 24:1a13c998c7ac 489 TEST_D.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 490 }
gabrieltetar 21:d137ec53c3a9 491 }
gabrieltetar 21:d137ec53c3a9 492 break;
gabrieltetar 21:d137ec53c3a9 493
gabrieltetar 21:d137ec53c3a9 494 case TEST_MOTEUR:
gabrieltetar 21:d137ec53c3a9 495 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 496 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 497 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 498 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 499 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Moteur", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 500 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 501 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 502 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 503 while(strat_etat_s==TEST_MOTEUR) {
gabrieltetar 21:d137ec53c3a9 504 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 505 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 506 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 507 } else if(TEST_A.Touched()) {
gabrieltetar 21:d137ec53c3a9 508 while (TEST_A.Touched());
gabrieltetar 21:d137ec53c3a9 509 BendRadius(150,1800,1,0);
gabrieltetar 21:d137ec53c3a9 510 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 511 } else if(TEST_B.Touched()) {
gabrieltetar 21:d137ec53c3a9 512 while (TEST_B.Touched());
gabrieltetar 21:d137ec53c3a9 513 BendRadius(150,1800,0,0);
gabrieltetar 21:d137ec53c3a9 514 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 515 }
gabrieltetar 21:d137ec53c3a9 516 }
gabrieltetar 21:d137ec53c3a9 517 break; ///////////////////////////////////////////FIN DES DEMOS/////////////////////////////////////////////////
gabrieltetar 21:d137ec53c3a9 518
gabrieltetar 21:d137ec53c3a9 519
gabrieltetar 21:d137ec53c3a9 520 case SELECT_SIDE : // CHOIX DU COTE DU TERRAIN + INVERSION DE LA STRAT SI COTE ORANGE+ ENVOI DU COTE A LA CARTE CAPTEUR/ACTIONNEURS
gabrieltetar 21:d137ec53c3a9 521 lcd.Clear(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 522 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 523 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 524
gabrieltetar 21:d137ec53c3a9 525 lcd.DisplayStringAt(70, LINE(0), (uint8_t *)"Choisir le cote", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 526 COTE_JAUNE.Draw(JAUNE, 0);
gabrieltetar 21:d137ec53c3a9 527 COTE_VIOLET.Draw(VIOLET, 0);
gabrieltetar 21:d137ec53c3a9 528 RETOUR.Draw(LCD_COLOR_RED, 0);
gabrieltetar 21:d137ec53c3a9 529
gabrieltetar 21:d137ec53c3a9 530
gabrieltetar 21:d137ec53c3a9 531 while (strat_etat_s == SELECT_SIDE) {
gabrieltetar 21:d137ec53c3a9 532 canProcessRx();
gabrieltetar 21:d137ec53c3a9 533 if(COTE_JAUNE.Touched()) {
maximilienlv 28:7f2990747e09 534 Cote = 0x1;
gabrieltetar 21:d137ec53c3a9 535 InversStrat = Cote;
gabrieltetar 21:d137ec53c3a9 536 strat_etat_s = TACTIQUE;
gabrieltetar 21:d137ec53c3a9 537 CANMessage trame_Tx = CANMessage();
gabrieltetar 21:d137ec53c3a9 538 trame_Tx.len = 1;
gabrieltetar 21:d137ec53c3a9 539 trame_Tx.format = CANStandard;
gabrieltetar 21:d137ec53c3a9 540 trame_Tx.type = CANData;
gabrieltetar 21:d137ec53c3a9 541 trame_Tx.id=CHOICE_COLOR;
gabrieltetar 21:d137ec53c3a9 542 trame_Tx.data[0]=Cote;
gabrieltetar 21:d137ec53c3a9 543 can2.write(trame_Tx);
gabrieltetar 21:d137ec53c3a9 544 while(COTE_JAUNE.Touched());
gabrieltetar 21:d137ec53c3a9 545
gabrieltetar 21:d137ec53c3a9 546 }
gabrieltetar 21:d137ec53c3a9 547
gabrieltetar 21:d137ec53c3a9 548 if(COTE_VIOLET.Touched()) {
maximilienlv 28:7f2990747e09 549 Cote = 0x0;
gabrieltetar 21:d137ec53c3a9 550 InversStrat= Cote;
gabrieltetar 21:d137ec53c3a9 551 strat_etat_s = TACTIQUE;
gabrieltetar 21:d137ec53c3a9 552 CANMessage trame_Tx = CANMessage();
gabrieltetar 21:d137ec53c3a9 553 trame_Tx.len = 1;
gabrieltetar 21:d137ec53c3a9 554 trame_Tx.format = CANStandard;
gabrieltetar 21:d137ec53c3a9 555 trame_Tx.type = CANData;
gabrieltetar 21:d137ec53c3a9 556 trame_Tx.id=CHOICE_COLOR;
gabrieltetar 21:d137ec53c3a9 557 trame_Tx.data[0]=Cote;
gabrieltetar 21:d137ec53c3a9 558 can2.write(trame_Tx);
gabrieltetar 21:d137ec53c3a9 559 while(COTE_VIOLET.Touched());
gabrieltetar 21:d137ec53c3a9 560 }
gabrieltetar 21:d137ec53c3a9 561
gabrieltetar 21:d137ec53c3a9 562 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 563 strat_etat_s = CHOIX;
gabrieltetar 21:d137ec53c3a9 564 while(RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 565 }
gabrieltetar 21:d137ec53c3a9 566 }
gabrieltetar 21:d137ec53c3a9 567
gabrieltetar 21:d137ec53c3a9 568 break;
gabrieltetar 21:d137ec53c3a9 569
gabrieltetar 21:d137ec53c3a9 570 case TACTIQUE : //AFFICHE LA LISTE DES STRATS AFIN DE SELECTIONNER CELLE VOULUE
slowness 29:ff575aff301f 571 if (Cote == 1) {
gabrieltetar 21:d137ec53c3a9 572 lcd.Clear(JAUNE);
gabrieltetar 21:d137ec53c3a9 573 lcd.SetBackColor(JAUNE);
slowness 29:ff575aff301f 574 } else if (Cote == 0) {
gabrieltetar 21:d137ec53c3a9 575 lcd.Clear(VIOLET);
gabrieltetar 21:d137ec53c3a9 576 lcd.SetBackColor(VIOLET);
gabrieltetar 21:d137ec53c3a9 577 } else {
gabrieltetar 21:d137ec53c3a9 578 lcd.Clear(BLEU);
gabrieltetar 21:d137ec53c3a9 579 lcd.SetBackColor(BLEU);
gabrieltetar 21:d137ec53c3a9 580 }
gabrieltetar 21:d137ec53c3a9 581
gabrieltetar 21:d137ec53c3a9 582 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 583
gabrieltetar 21:d137ec53c3a9 584 lcd.DisplayStringAt(20, LINE(0), (uint8_t *)"Choisir une strategie", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 585
gabrieltetar 21:d137ec53c3a9 586 nbStrat = Bouton_Strat(); // retourne valeur de Strategie si bouton strat renvoi -1 on reviens en arriere
gabrieltetar 21:d137ec53c3a9 587 if (nbStrat == -1) {
gabrieltetar 21:d137ec53c3a9 588 strat_etat_s = SELECT_SIDE;
gabrieltetar 21:d137ec53c3a9 589 } else {
gabrieltetar 21:d137ec53c3a9 590 strat_etat_s = DETAILS;
gabrieltetar 21:d137ec53c3a9 591 }
gabrieltetar 21:d137ec53c3a9 592 wait(0.1);
gabrieltetar 21:d137ec53c3a9 593 break;
gabrieltetar 21:d137ec53c3a9 594
gabrieltetar 21:d137ec53c3a9 595 case DETAILS : //SECONDE VALIDATION DE LA STRAT
gabrieltetar 21:d137ec53c3a9 596 lcd.Clear(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 597 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 598 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 599 CHECK.Draw(VERT);
gabrieltetar 21:d137ec53c3a9 600 RETOUR.Draw(LCD_COLOR_RED);
gabrieltetar 21:d137ec53c3a9 601
gabrieltetar 21:d137ec53c3a9 602 SelectionStrat(nbStrat); //affiche la stratégie selectionnée
gabrieltetar 21:d137ec53c3a9 603
gabrieltetar 21:d137ec53c3a9 604 while (strat_etat_s == DETAILS) {
gabrieltetar 21:d137ec53c3a9 605 canProcessRx();
gabrieltetar 21:d137ec53c3a9 606 if (CHECK.Touched()) {
gabrieltetar 21:d137ec53c3a9 607 if(gameEtat == ETAT_CONFIG) {
gabrieltetar 21:d137ec53c3a9 608 gameEtat = ETAT_GAME_INIT;
gabrieltetar 21:d137ec53c3a9 609 strat_etat_s=LECTURE;
gabrieltetar 21:d137ec53c3a9 610
gabrieltetar 21:d137ec53c3a9 611 }
gabrieltetar 21:d137ec53c3a9 612 while(CHECK.Touched());
gabrieltetar 21:d137ec53c3a9 613 }
gabrieltetar 21:d137ec53c3a9 614
gabrieltetar 21:d137ec53c3a9 615 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 616 strat_etat_s = TACTIQUE;
gabrieltetar 21:d137ec53c3a9 617 while(RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 618 }
gabrieltetar 21:d137ec53c3a9 619 }
gabrieltetar 21:d137ec53c3a9 620 break;
gabrieltetar 21:d137ec53c3a9 621
gabrieltetar 21:d137ec53c3a9 622
gabrieltetar 21:d137ec53c3a9 623 case LECTURE :
gabrieltetar 21:d137ec53c3a9 624 break;
gabrieltetar 21:d137ec53c3a9 625 case AFF_WAIT_JACK : //FONCTIONS D'AFFICHAGE DE L'ATTENTE DU JACK
gabrieltetar 21:d137ec53c3a9 626 lcd.Clear(BLANC);
gabrieltetar 21:d137ec53c3a9 627 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 628 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 629
gabrieltetar 21:d137ec53c3a9 630 if (Cote == 0) {
gabrieltetar 21:d137ec53c3a9 631 lcd.Clear(VERT);
gabrieltetar 21:d137ec53c3a9 632 lcd.SetBackColor(VERT);
gabrieltetar 21:d137ec53c3a9 633 } else if (Cote == 1) {
gabrieltetar 21:d137ec53c3a9 634 lcd.Clear(ORANGE);
gabrieltetar 21:d137ec53c3a9 635 lcd.SetBackColor(ORANGE);
gabrieltetar 21:d137ec53c3a9 636 } else {
gabrieltetar 21:d137ec53c3a9 637 lcd.Clear(VERT);
gabrieltetar 21:d137ec53c3a9 638 lcd.SetBackColor(VERT);
gabrieltetar 21:d137ec53c3a9 639 }
gabrieltetar 21:d137ec53c3a9 640 canProcessRx();
gabrieltetar 21:d137ec53c3a9 641 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"En attente du Jack", CENTER_MODE);
gabrieltetar 21:d137ec53c3a9 642 strat_etat_s=WAIT_JACK;
gabrieltetar 21:d137ec53c3a9 643 break;
gabrieltetar 21:d137ec53c3a9 644
gabrieltetar 21:d137ec53c3a9 645 case WAIT_JACK: //VERITABLE ATTENTE DU JACK
gabrieltetar 21:d137ec53c3a9 646 break;
gabrieltetar 21:d137ec53c3a9 647
gabrieltetar 21:d137ec53c3a9 648 case FIN : //AFFICHAGE DE FIN AVEC LE SCORE FINAL
gabrieltetar 21:d137ec53c3a9 649 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 650 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 651
gabrieltetar 21:d137ec53c3a9 652
gabrieltetar 21:d137ec53c3a9 653 while(1); // force le redemarage du robot
gabrieltetar 21:d137ec53c3a9 654 //break;
gabrieltetar 21:d137ec53c3a9 655
gabrieltetar 21:d137ec53c3a9 656 }
gabrieltetar 21:d137ec53c3a9 657 }
gabrieltetar 21:d137ec53c3a9 658 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 659 /* FUNCTION NAME: Bouton_Strat */
gabrieltetar 21:d137ec53c3a9 660 /* DESCRIPTION : Sélection de la strat sur le lcd puis envoie sur CAN (à modifier!) */
gabrieltetar 21:d137ec53c3a9 661 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 662 signed char Bouton_Strat (void)
gabrieltetar 21:d137ec53c3a9 663 {
gabrieltetar 21:d137ec53c3a9 664 char Ack_strat = 0;
gabrieltetar 21:d137ec53c3a9 665 signed char Strat = 0;
gabrieltetar 21:d137ec53c3a9 666 Button STRAT_1 (0, 30, 190, 110, strat_sd[0]);
gabrieltetar 21:d137ec53c3a9 667 Button STRAT_2 (210, 30, 190, 110, strat_sd[1]);
gabrieltetar 21:d137ec53c3a9 668 Button STRAT_3 (0, 150, 190, 110, strat_sd[2]);
gabrieltetar 21:d137ec53c3a9 669 Button STRAT_4 (210, 150, 190, 110, strat_sd[3]);
gabrieltetar 21:d137ec53c3a9 670 Button STRAT_5 (0, 270, 190, 110,strat_sd[4]);
gabrieltetar 21:d137ec53c3a9 671 Button STRAT_6 (210, 270, 190, 110, strat_sd[5]);
gabrieltetar 21:d137ec53c3a9 672 Button STRAT_7 (0, 390, 190, 110, strat_sd[6]);
gabrieltetar 21:d137ec53c3a9 673 Button STRAT_8 (210, 390, 190, 110, strat_sd[7]);
gabrieltetar 21:d137ec53c3a9 674 Button STRAT_9 (0, 510, 190, 110, strat_sd[8]);
gabrieltetar 21:d137ec53c3a9 675 Button STRAT_10 (210, 510, 190, 110, strat_sd[9]);
gabrieltetar 21:d137ec53c3a9 676 Button RETOUR (0, 680, 400, 110, "--Precedent--");
gabrieltetar 21:d137ec53c3a9 677 //Definition des boutons
gabrieltetar 21:d137ec53c3a9 678
gabrieltetar 21:d137ec53c3a9 679 Ack_strat = 0;
gabrieltetar 21:d137ec53c3a9 680 Strat = 0;
gabrieltetar 21:d137ec53c3a9 681 STRAT_1.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 682 STRAT_2.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 683 STRAT_3.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 684 STRAT_4.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 685 STRAT_5.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 686 STRAT_6.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 687 STRAT_7.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 688 STRAT_8.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 689 STRAT_9.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 690 STRAT_10.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 691 RETOUR.Draw(0xFFFF0000, 0);
gabrieltetar 21:d137ec53c3a9 692
gabrieltetar 21:d137ec53c3a9 693 while(Ack_strat == 0) {
gabrieltetar 21:d137ec53c3a9 694 canProcessRx();
gabrieltetar 21:d137ec53c3a9 695 CANMessage msgTx=CANMessage();
gabrieltetar 21:d137ec53c3a9 696 //msgTx.id=ECRAN_CHOICE_STRAT;
gabrieltetar 21:d137ec53c3a9 697 if (RETOUR.Touched())
gabrieltetar 21:d137ec53c3a9 698 return -1;
gabrieltetar 21:d137ec53c3a9 699 while(RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 700 //////////////////////////////STRATEGIE N°1
gabrieltetar 21:d137ec53c3a9 701 if (STRAT_1.Touched()) {
gabrieltetar 21:d137ec53c3a9 702 Strat = 0;
gabrieltetar 21:d137ec53c3a9 703 //msgTx.data[0] = 0x1;
gabrieltetar 21:d137ec53c3a9 704 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 705 while(STRAT_1.Touched());
gabrieltetar 21:d137ec53c3a9 706 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 707 }
gabrieltetar 21:d137ec53c3a9 708 /////////////////////////////STRATEGIE N°2
gabrieltetar 21:d137ec53c3a9 709 if (STRAT_2.Touched()) {
gabrieltetar 21:d137ec53c3a9 710 Strat = 1;
gabrieltetar 21:d137ec53c3a9 711 //msgTx.data[0] = 0x2;
gabrieltetar 21:d137ec53c3a9 712 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 713 while(STRAT_2.Touched());
gabrieltetar 21:d137ec53c3a9 714 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 715 }
gabrieltetar 21:d137ec53c3a9 716 //////////////////////////////STRATEGIE N°3
gabrieltetar 21:d137ec53c3a9 717 if (STRAT_3.Touched()) {
gabrieltetar 21:d137ec53c3a9 718 Strat = 2;
gabrieltetar 21:d137ec53c3a9 719 //msgTx.data[0] = 0x3;
gabrieltetar 21:d137ec53c3a9 720 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 721 while(STRAT_3.Touched());
gabrieltetar 21:d137ec53c3a9 722 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 723 }
gabrieltetar 21:d137ec53c3a9 724 /////////////////////////////STRATEGIE N°4
gabrieltetar 21:d137ec53c3a9 725 if (STRAT_4.Touched()) {
gabrieltetar 21:d137ec53c3a9 726 Strat = 3;
gabrieltetar 21:d137ec53c3a9 727 //msgTx.data[0] = 0x4;
gabrieltetar 21:d137ec53c3a9 728 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 729 while(STRAT_4.Touched());
gabrieltetar 21:d137ec53c3a9 730 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 731 }
gabrieltetar 21:d137ec53c3a9 732 ///////////////////////////////STRATEGIE N°5
gabrieltetar 21:d137ec53c3a9 733 if (STRAT_5.Touched()) {
gabrieltetar 21:d137ec53c3a9 734 Strat = 4;
gabrieltetar 21:d137ec53c3a9 735 //msgTx.data[0] = 0x5;
gabrieltetar 21:d137ec53c3a9 736 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 737 while(STRAT_5.Touched());
gabrieltetar 21:d137ec53c3a9 738 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 739 }
gabrieltetar 21:d137ec53c3a9 740 ////////////////////////////////STRATEGIE N°6
gabrieltetar 21:d137ec53c3a9 741 if (STRAT_6.Touched()) {
gabrieltetar 21:d137ec53c3a9 742 Strat = 5;
gabrieltetar 21:d137ec53c3a9 743 //msgTx.data[0] = 0x6;
gabrieltetar 21:d137ec53c3a9 744 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 745 while(STRAT_6.Touched());
gabrieltetar 21:d137ec53c3a9 746 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 747 }
gabrieltetar 21:d137ec53c3a9 748 /////////////////////////////////STRATEGIE N°7
gabrieltetar 21:d137ec53c3a9 749 if (STRAT_7.Touched()) {
gabrieltetar 21:d137ec53c3a9 750 Strat = 6;
gabrieltetar 21:d137ec53c3a9 751 //msgTx.data[0] = 0x7;
gabrieltetar 21:d137ec53c3a9 752 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 753 while(STRAT_7.Touched());
gabrieltetar 21:d137ec53c3a9 754 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 755 }
gabrieltetar 21:d137ec53c3a9 756 /////////////////////////////////STRATEGIE N°8
gabrieltetar 21:d137ec53c3a9 757 if (STRAT_8.Touched()) {
gabrieltetar 21:d137ec53c3a9 758 Strat = 7;
gabrieltetar 21:d137ec53c3a9 759 //msgTx.data[0] = 0x8;
gabrieltetar 21:d137ec53c3a9 760 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 761 while(STRAT_8.Touched());
gabrieltetar 21:d137ec53c3a9 762 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 763 }
gabrieltetar 21:d137ec53c3a9 764 /////////////////////////////////STRATEGIE N°9
gabrieltetar 21:d137ec53c3a9 765 if (STRAT_9.Touched()) {
gabrieltetar 21:d137ec53c3a9 766 Strat = 8;
gabrieltetar 21:d137ec53c3a9 767 //msgTx.data[0] = 0x9;
gabrieltetar 21:d137ec53c3a9 768 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 769 while(STRAT_9.Touched());
gabrieltetar 21:d137ec53c3a9 770 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 771 }
gabrieltetar 21:d137ec53c3a9 772 ///////////////////////////////////STRATEGIE N°10
gabrieltetar 21:d137ec53c3a9 773 if (STRAT_10.Touched()) {
gabrieltetar 21:d137ec53c3a9 774 Strat = 9;
gabrieltetar 21:d137ec53c3a9 775 //msgTx.data[0] = 0xA;
gabrieltetar 21:d137ec53c3a9 776 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 777 while(STRAT_10.Touched());
gabrieltetar 21:d137ec53c3a9 778 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 779 }
gabrieltetar 21:d137ec53c3a9 780
gabrieltetar 21:d137ec53c3a9 781 }
gabrieltetar 21:d137ec53c3a9 782 return Strat;
gabrieltetar 21:d137ec53c3a9 783
gabrieltetar 21:d137ec53c3a9 784 }
gabrieltetar 21:d137ec53c3a9 785 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 786 /* FUNCTION NAME: SelectionStrat */
gabrieltetar 21:d137ec53c3a9 787 /* DESCRIPTION : Affiche la Stratégie sélectionnée sur l'ihm */
gabrieltetar 21:d137ec53c3a9 788 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 789
gabrieltetar 21:d137ec53c3a9 790
gabrieltetar 21:d137ec53c3a9 791 void SelectionStrat (unsigned char Strategie)
gabrieltetar 21:d137ec53c3a9 792 {
gabrieltetar 21:d137ec53c3a9 793 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 794 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 795
gabrieltetar 21:d137ec53c3a9 796 switch (Strategie+1) {
gabrieltetar 21:d137ec53c3a9 797 case 0x1 :
gabrieltetar 21:d137ec53c3a9 798 //description de Strategie n°1
gabrieltetar 21:d137ec53c3a9 799 lcd.DisplayStringAt(150, 0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 800 break;
gabrieltetar 21:d137ec53c3a9 801
gabrieltetar 21:d137ec53c3a9 802 case 0x2 :
gabrieltetar 21:d137ec53c3a9 803 //description de Strategie n°2
gabrieltetar 21:d137ec53c3a9 804 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 805 break;
gabrieltetar 21:d137ec53c3a9 806
gabrieltetar 21:d137ec53c3a9 807 case 0x3 :
gabrieltetar 21:d137ec53c3a9 808 //description de Strategie n°3
gabrieltetar 21:d137ec53c3a9 809 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 810 break;
gabrieltetar 21:d137ec53c3a9 811
gabrieltetar 21:d137ec53c3a9 812 case 0x4 :
gabrieltetar 21:d137ec53c3a9 813 //description de Strategie n°4
gabrieltetar 21:d137ec53c3a9 814 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 815 break;
gabrieltetar 21:d137ec53c3a9 816
gabrieltetar 21:d137ec53c3a9 817 case 0x5 :
gabrieltetar 21:d137ec53c3a9 818 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 819 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 820 break;
gabrieltetar 21:d137ec53c3a9 821
gabrieltetar 21:d137ec53c3a9 822 case 0x6 :
gabrieltetar 21:d137ec53c3a9 823 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 824 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 825 break;
gabrieltetar 21:d137ec53c3a9 826
gabrieltetar 21:d137ec53c3a9 827 case 0x7 :
gabrieltetar 21:d137ec53c3a9 828 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 829 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 830 break;
gabrieltetar 21:d137ec53c3a9 831
gabrieltetar 21:d137ec53c3a9 832 case 0x8 :
gabrieltetar 21:d137ec53c3a9 833 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 834 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 835 break;
gabrieltetar 21:d137ec53c3a9 836
gabrieltetar 21:d137ec53c3a9 837 case 0x9 :
gabrieltetar 21:d137ec53c3a9 838 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 839 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 840 break;
gabrieltetar 21:d137ec53c3a9 841
gabrieltetar 21:d137ec53c3a9 842 case 0xA :
gabrieltetar 21:d137ec53c3a9 843 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 844 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 845 break;
gabrieltetar 21:d137ec53c3a9 846 }
gabrieltetar 27:ff70537a7619 847 }
gabrieltetar 27:ff70537a7619 848
gabrieltetar 27:ff70537a7619 849 void DrawC (int l,int h,int x, int y, unsigned char fill){
gabrieltetar 27:ff70537a7619 850 Point c[8]={{l,0},{l,h/6},{l/5,h/3},{l/5,2*(h/3)},{l,5*(h/6)},{l,h},{0,5*(h/6)},{0,h/6}};
gabrieltetar 27:ff70537a7619 851 for(int a=0;a<8;a++){
gabrieltetar 27:ff70537a7619 852 c[a].X+=x;
gabrieltetar 27:ff70537a7619 853 c[a].Y+=y;
gabrieltetar 27:ff70537a7619 854 }
gabrieltetar 27:ff70537a7619 855 lcd.DrawPolygon(c, 8);
gabrieltetar 27:ff70537a7619 856
gabrieltetar 27:ff70537a7619 857 }
gabrieltetar 27:ff70537a7619 858 void DrawR (int l,int h,int x, int y, unsigned char fill){
gabrieltetar 27:ff70537a7619 859 Point r[10]={{0,0},{5*(l/6),0},{l,h/3},{5*(l/6),h/2},{l/2,h/2},{l,h},{2*(l/3),h},{l/4,h/2},{l/4,h},{0,h}};
gabrieltetar 27:ff70537a7619 860 for(int a=0;a<10;a++){
gabrieltetar 27:ff70537a7619 861 r[a].X+=x;
gabrieltetar 27:ff70537a7619 862 r[a].Y+=y;
gabrieltetar 27:ff70537a7619 863 }
gabrieltetar 27:ff70537a7619 864 lcd.DrawPolygon(r, 10);
gabrieltetar 27:ff70537a7619 865 }
gabrieltetar 27:ff70537a7619 866 void DrawA (int l,int h,int x, int y, unsigned char fill){
gabrieltetar 27:ff70537a7619 867 Point a[8]={{l/4,0},{3*(l/4),0},{l,h},{5*(l/6),h},{4*(l/6),h/2},{2*(l/6),h/2},{l/6,h},{0,h}};
gabrieltetar 27:ff70537a7619 868 for(int z=0;z<8;z++){
gabrieltetar 27:ff70537a7619 869 a[z].X+=x;
gabrieltetar 27:ff70537a7619 870 a[z].Y+=y;
gabrieltetar 27:ff70537a7619 871 }
gabrieltetar 27:ff70537a7619 872 lcd.DrawPolygon(a, 8);
gabrieltetar 27:ff70537a7619 873 }
gabrieltetar 27:ff70537a7619 874 void DrawCheck (int l,int h,int x, int y, int cochage){
gabrieltetar 27:ff70537a7619 875 if(x<3)x=3;
gabrieltetar 27:ff70537a7619 876 if(cochage == 1){
gabrieltetar 27:ff70537a7619 877 lcd.SetTextColor(VERT_F);
gabrieltetar 27:ff70537a7619 878 lcd.DrawLine(x,y-(h/2),x+l/2,y+h/2);
gabrieltetar 27:ff70537a7619 879 lcd.DrawLine(x-1,y-(h/2),x+l/2,y+h/2+1);
gabrieltetar 27:ff70537a7619 880 lcd.DrawLine(x-2,y-(h/2),x+l/2,y+h/2+2);
gabrieltetar 27:ff70537a7619 881 lcd.DrawLine(x+l/2,y+h/2,x+(4*(l/3)),y);
gabrieltetar 27:ff70537a7619 882 lcd.DrawLine(x+l/2,y+h/2+1,x+(4*(l/3))+1,y);
gabrieltetar 27:ff70537a7619 883 lcd.DrawLine(x+l/2,y+h/2+2,x+(4*(l/3))+2,y);
gabrieltetar 27:ff70537a7619 884 lcd.SetTextColor(NOIR);
gabrieltetar 27:ff70537a7619 885 } else {
gabrieltetar 27:ff70537a7619 886 Point a[4]={{0,0},{l,0},{l,h},{0,h}};
gabrieltetar 27:ff70537a7619 887 for(int z=0;z<8;z++){
gabrieltetar 27:ff70537a7619 888 a[z].X+=x;
gabrieltetar 27:ff70537a7619 889 a[z].Y+=y;
gabrieltetar 27:ff70537a7619 890 }
gabrieltetar 27:ff70537a7619 891 lcd.DrawPolygon(a, 4);
gabrieltetar 27:ff70537a7619 892 }
gabrieltetar 21:d137ec53c3a9 893 }