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

Dependencies:   mbed SerialHalfDuplex SDFileSystem liaison_Bluetooth ident_crac DISCO-F469NI_portrait

Committer:
goldmas
Date:
Mon May 17 07:19:15 2021 +0000
Revision:
34:c314feaa0d3e
Parent:
33:c54841d11156
Child:
35:2a745eeb7922
Test des ventouses et des bras fct avec les new identifiants;

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");
goldmas 33:c54841d11156 22 Button COTE_VIOLET(0, 350, 400, 300, "BLEU");
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");
goldmas 32:7f8e3ee2adac 44 Button TEST_ATTRAPER(0,300,400,100,"Attraper");
goldmas 32:7f8e3ee2adac 45 Button TEST_RELACHER(0,450,400,100,"Relacher");
goldmas 32:7f8e3ee2adac 46
gabrieltetar 21:d137ec53c3a9 47 Button TEST_PLUS(205,355,195,100,"+");
gabrieltetar 21:d137ec53c3a9 48 Button TEST_MOINS(0,355,195,100,"-");
goldmas 34:c314feaa0d3e 49 Button TEST_SERVO_0(280,50,120,100,"Bras 0");
goldmas 32:7f8e3ee2adac 50 Button TEST_SERVO_1(140,50,120,100,"Bras 1");
goldmas 34:c314feaa0d3e 51 Button TEST_SERVO_2(0,50,120,100,"Bras 2");
goldmas 32:7f8e3ee2adac 52 Button TEST_SERVO_3(0,160,120,100,"Bras 3");
goldmas 32:7f8e3ee2adac 53 Button TEST_SERVO_4(140,160,120,100,"Bras 4");
goldmas 32:7f8e3ee2adac 54 Button TEST_SERVO_5(280,160,120,100,"Bras 5");
goldmas 34:c314feaa0d3e 55
goldmas 34:c314feaa0d3e 56 Button TEST_VENT_0(280,50,120,100,"Vent 0");
goldmas 34:c314feaa0d3e 57 Button TEST_VENT_1(140,50,120,100,"Vent 1");
goldmas 34:c314feaa0d3e 58 Button TEST_VENT_2(0,50,120,100,"Vent 2");
goldmas 34:c314feaa0d3e 59 Button TEST_VENT_3(0,160,120,100,"Vent 3");
goldmas 34:c314feaa0d3e 60 Button TEST_VENT_4(140,160,120,100,"Vent 4");
goldmas 34:c314feaa0d3e 61 Button TEST_VENT_5(280,160,120,100,"Vent 5");
goldmas 34:c314feaa0d3e 62
gabrieltetar 22:c7763a7ec6c7 63 Button FORCE_LAUNCH(0, 600, 400, 100, "Force Launch");
gabrieltetar 21:d137ec53c3a9 64 Button SUIVANT(0,380,200,100,"Suivant");
gabrieltetar 21:d137ec53c3a9 65 ////////////////////////////////////////////////////////////
gabrieltetar 24:1a13c998c7ac 66
gabrieltetar 21:d137ec53c3a9 67 signed char Bouton_Strat (void);
gabrieltetar 27:ff70537a7619 68 void DrawC (int l,int h,int x, int y, unsigned char fill);
gabrieltetar 27:ff70537a7619 69 void DrawR (int l,int h,int x, int y, unsigned char fill);
gabrieltetar 27:ff70537a7619 70 void DrawA (int l,int h,int x, int y, unsigned char fill);
gabrieltetar 24:1a13c998c7ac 71
gabrieltetar 21:d137ec53c3a9 72 void SelectionStrat (unsigned char numeroStrat);
gabrieltetar 21:d137ec53c3a9 73
gabrieltetar 21:d137ec53c3a9 74 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 75 /* FUNCTION NAME: automate_etat_ihm */
gabrieltetar 21:d137ec53c3a9 76 /* DESCRIPTION : Automate de gestion de l'affichage */
gabrieltetar 21:d137ec53c3a9 77 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 78 void automate_etat_ihm(void)
gabrieltetar 21:d137ec53c3a9 79 {
goldmas 32:7f8e3ee2adac 80 char toto[12];
gabrieltetar 21:d137ec53c3a9 81 int j;
goldmas 32:7f8e3ee2adac 82 unsigned char maximilien=1, choix_groupe;
gabrieltetar 21:d137ec53c3a9 83 if (j==0) {
gabrieltetar 21:d137ec53c3a9 84 ts.Init(lcd.GetXSize(), lcd.GetYSize());
gabrieltetar 21:d137ec53c3a9 85 j++;
gabrieltetar 21:d137ec53c3a9 86 }
gabrieltetar 21:d137ec53c3a9 87 ts.GetState(&TS_State);
gabrieltetar 21:d137ec53c3a9 88 switch (strat_etat_s) {
gabrieltetar 24:1a13c998c7ac 89 case INIT : //intialise l'écran et passe à l'attente d'initialisation des cartes
gabrieltetar 21:d137ec53c3a9 90 ts.GetState(&TS_State);
gabrieltetar 22:c7763a7ec6c7 91 canProcessRx();
gabrieltetar 24:1a13c998c7ac 92 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 93 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 24:1a13c998c7ac 94 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 95 wait(0.15);
gabrieltetar 27:ff70537a7619 96 DrawC(95,150,0,50,0);
gabrieltetar 27:ff70537a7619 97 DrawR(95,150,105,50,0);
gabrieltetar 27:ff70537a7619 98 DrawA(95,150,210,50,0);
gabrieltetar 27:ff70537a7619 99 DrawC(95,150,315,50,0);
gabrieltetar 27:ff70537a7619 100 DrawCheck(30,30,50,243,0);
gabrieltetar 27:ff70537a7619 101 DrawCheck(30,30,50,293,0);
gabrieltetar 27:ff70537a7619 102 DrawCheck(30,30,50,343,0);
gabrieltetar 27:ff70537a7619 103 DrawCheck(30,30,50,393,0);
gabrieltetar 27:ff70537a7619 104 lcd.DisplayStringAt(100, 250, (uint8_t *)"Init CAN", LEFT_MODE);
slowness 29:ff575aff301f 105 DrawCheck(30,30,50,243,can_present);
gabrieltetar 27:ff70537a7619 106 lcd.DisplayStringAt(100, 300, (uint8_t *)"Micro SD", LEFT_MODE);
slowness 29:ff575aff301f 107 DrawCheck(30,30,50,293,sd_present);
gabrieltetar 27:ff70537a7619 108 lcd.DisplayStringAt(100, 350, (uint8_t *)"Carte Moteur", LEFT_MODE);
gabrieltetar 27:ff70537a7619 109 lcd.DisplayStringAt(100, 400, (uint8_t *)"Balise IR", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 110 FORCE_LAUNCH.Draw(0xFFFF0000, 0);
gabrieltetar 24:1a13c998c7ac 111
gabrieltetar 24:1a13c998c7ac 112 strat_etat_s=ATT;
gabrieltetar 24:1a13c998c7ac 113 break;
gabrieltetar 24:1a13c998c7ac 114
gabrieltetar 24:1a13c998c7ac 115 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 116 if (flag_check_carte==1) {
gabrieltetar 24:1a13c998c7ac 117 strat_etat_s = CHOIX;
gabrieltetar 24:1a13c998c7ac 118 gameEtat = ETAT_CONFIG;
gabrieltetar 24:1a13c998c7ac 119 } else if (FORCE_LAUNCH.Touched()) {
gabrieltetar 24:1a13c998c7ac 120 strat_etat_s = CHOIX;
gabrieltetar 24:1a13c998c7ac 121 gameEtat = ETAT_CONFIG;
gabrieltetar 24:1a13c998c7ac 122 while(FORCE_LAUNCH.Touched());
gabrieltetar 21:d137ec53c3a9 123 }
gabrieltetar 24:1a13c998c7ac 124
gabrieltetar 21:d137ec53c3a9 125 break;
gabrieltetar 24:1a13c998c7ac 126
gabrieltetar 24:1a13c998c7ac 127
gabrieltetar 21:d137ec53c3a9 128 case CHOIX : //Match ou DEMO
gabrieltetar 21:d137ec53c3a9 129 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 130 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 131 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 132 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Match ou demonstration ?", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 133 DEMONSTRATION.Draw(LCD_COLOR_LIGHTGREEN, 0);
gabrieltetar 21:d137ec53c3a9 134 MATCH.Draw(0xFFF01010, 0);
gabrieltetar 21:d137ec53c3a9 135 while(strat_etat_s == CHOIX) {
gabrieltetar 21:d137ec53c3a9 136 canProcessRx();
gabrieltetar 21:d137ec53c3a9 137 if(DEMONSTRATION.Touched()) {
gabrieltetar 21:d137ec53c3a9 138 strat_etat_s = DEMO;
gabrieltetar 21:d137ec53c3a9 139 while(DEMONSTRATION.Touched());
gabrieltetar 21:d137ec53c3a9 140 }
gabrieltetar 21:d137ec53c3a9 141
gabrieltetar 21:d137ec53c3a9 142 if(MATCH.Touched()) {
gabrieltetar 21:d137ec53c3a9 143 strat_etat_s = SELECT_SIDE;
gabrieltetar 21:d137ec53c3a9 144 while(MATCH.Touched());
gabrieltetar 21:d137ec53c3a9 145 }
gabrieltetar 21:d137ec53c3a9 146
gabrieltetar 21:d137ec53c3a9 147 }
gabrieltetar 21:d137ec53c3a9 148 break;
gabrieltetar 21:d137ec53c3a9 149
gabrieltetar 21:d137ec53c3a9 150 case DEMO :
gabrieltetar 21:d137ec53c3a9 151 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 152 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 153 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 22:c7763a7ec6c7 154 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"DEMO 1/2", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 155 RETOUR.Draw(0xFFFF0000, 0);
gabrieltetar 21:d137ec53c3a9 156 TEST_VENT.Draw(VERT, 0);
gabrieltetar 21:d137ec53c3a9 157 TEST_MOT.Draw(VERT, 0);
gabrieltetar 21:d137ec53c3a9 158 TEST_COUL.Draw(VERT, 0);
gabrieltetar 21:d137ec53c3a9 159 TEST_BRAS.Draw(VERT, 0);
gabrieltetar 21:d137ec53c3a9 160 TEST_AUDIO.Draw(VERT, 0);
gabrieltetar 22:c7763a7ec6c7 161 TEST_NEXT.Draw(BLEU, 0);
gabrieltetar 21:d137ec53c3a9 162 maximilien=0;
gabrieltetar 21:d137ec53c3a9 163 while (strat_etat_s == DEMO) {
gabrieltetar 21:d137ec53c3a9 164 canProcessRx();
gabrieltetar 21:d137ec53c3a9 165 if(TEST_VENT.Touched()) {
gabrieltetar 21:d137ec53c3a9 166 while(TEST_VENT.Touched());
gabrieltetar 21:d137ec53c3a9 167 strat_etat_s = TEST_VENTOUSE;
gabrieltetar 21:d137ec53c3a9 168 } else if(TEST_MOT.Touched()) {
gabrieltetar 21:d137ec53c3a9 169 while(TEST_MOT.Touched());
gabrieltetar 21:d137ec53c3a9 170 strat_etat_s = TEST_MOTEUR;
gabrieltetar 22:c7763a7ec6c7 171 } else if(TEST_NEXT.Touched()) {
gabrieltetar 22:c7763a7ec6c7 172 while(TEST_NEXT.Touched());
gabrieltetar 22:c7763a7ec6c7 173 strat_etat_s = DEMO2;
gabrieltetar 21:d137ec53c3a9 174 } else if (TEST_COUL.Touched()) {
gabrieltetar 21:d137ec53c3a9 175 while(TEST_COUL.Touched());
gabrieltetar 21:d137ec53c3a9 176 strat_etat_s =TEST_COULEUR ;
gabrieltetar 21:d137ec53c3a9 177 } else if (TEST_BRAS.Touched()) {
gabrieltetar 21:d137ec53c3a9 178 while(TEST_BRAS.Touched());
gabrieltetar 21:d137ec53c3a9 179 strat_etat_s =TEST_SERVO_BRAS ;
gabrieltetar 21:d137ec53c3a9 180 } else if(TEST_AUDIO.Touched()) {
gabrieltetar 21:d137ec53c3a9 181 while(TEST_AUDIO.Touched());
gabrieltetar 21:d137ec53c3a9 182 strat_etat_s=TEST_AUD;
gabrieltetar 21:d137ec53c3a9 183 } else if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 184 while(RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 185 strat_etat_s = CHOIX;
gabrieltetar 21:d137ec53c3a9 186 }
gabrieltetar 21:d137ec53c3a9 187 }
gabrieltetar 21:d137ec53c3a9 188 break;
gabrieltetar 24:1a13c998c7ac 189
gabrieltetar 24:1a13c998c7ac 190 case DEMO2 :
gabrieltetar 22:c7763a7ec6c7 191 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 22:c7763a7ec6c7 192 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 22:c7763a7ec6c7 193 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 22:c7763a7ec6c7 194 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"DEMO 2/2", LEFT_MODE);
gabrieltetar 22:c7763a7ec6c7 195 RETOUR.Draw(0xFFFF0000, 0);
gabrieltetar 22:c7763a7ec6c7 196 TEST_DIV.Draw(VERT, 0);
gabrieltetar 22:c7763a7ec6c7 197 TEST_ASSERV.Draw(VERT, 0);
gabrieltetar 22:c7763a7ec6c7 198 TEST_NEXT.Draw(BLEU, 0);
gabrieltetar 22:c7763a7ec6c7 199 maximilien=0;
gabrieltetar 22:c7763a7ec6c7 200 while (strat_etat_s == DEMO2) {
gabrieltetar 22:c7763a7ec6c7 201 canProcessRx();
gabrieltetar 22:c7763a7ec6c7 202 if(TEST_NEXT.Touched()) {
gabrieltetar 22:c7763a7ec6c7 203 while(TEST_NEXT.Touched());
gabrieltetar 22:c7763a7ec6c7 204 strat_etat_s = DEMO;
gabrieltetar 22:c7763a7ec6c7 205 } else if(TEST_DIV.Touched()) {
gabrieltetar 22:c7763a7ec6c7 206 while(TEST_DIV.Touched());
gabrieltetar 22:c7763a7ec6c7 207 strat_etat_s = TEST_DIVE;
gabrieltetar 22:c7763a7ec6c7 208 } else if(TEST_ASSERV.Touched()) {
gabrieltetar 22:c7763a7ec6c7 209 while(TEST_ASSERV.Touched());
gabrieltetar 22:c7763a7ec6c7 210 strat_etat_s = TEST_ASSERVE;
gabrieltetar 22:c7763a7ec6c7 211 } else if(RETOUR.Touched()) {
gabrieltetar 22:c7763a7ec6c7 212 while(RETOUR.Touched());
gabrieltetar 22:c7763a7ec6c7 213 strat_etat_s = CHOIX;
gabrieltetar 22:c7763a7ec6c7 214 }
gabrieltetar 22:c7763a7ec6c7 215 }
gabrieltetar 24:1a13c998c7ac 216 break;
gabrieltetar 24:1a13c998c7ac 217
gabrieltetar 24:1a13c998c7ac 218 case TEST_ASSERVE:
gabrieltetar 24:1a13c998c7ac 219 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 220 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 24:1a13c998c7ac 221 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 222 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Asservissements", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 223 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 24:1a13c998c7ac 224 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 225 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 226 while(strat_etat_s==TEST_ASSERVE) {
gabrieltetar 24:1a13c998c7ac 227 if(RETOUR.Touched()) {
gabrieltetar 24:1a13c998c7ac 228 while (RETOUR.Touched());
gabrieltetar 24:1a13c998c7ac 229 strat_etat_s=DEMO2;
gabrieltetar 24:1a13c998c7ac 230 } else if(TEST_A.Touched()) {
gabrieltetar 24:1a13c998c7ac 231 while (TEST_A.Touched());
gabrieltetar 24:1a13c998c7ac 232 GoToPosition(2000,0,0,0);
gabrieltetar 24:1a13c998c7ac 233 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 234 } else if(TEST_B.Touched()) {
gabrieltetar 24:1a13c998c7ac 235 while (TEST_B.Touched());
gabrieltetar 24:1a13c998c7ac 236 Rotate(3599);
gabrieltetar 24:1a13c998c7ac 237 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 238 }
gabrieltetar 24:1a13c998c7ac 239 }
gabrieltetar 24:1a13c998c7ac 240 break;
gabrieltetar 24:1a13c998c7ac 241
gabrieltetar 24:1a13c998c7ac 242 case TEST_DIVE:
gabrieltetar 24:1a13c998c7ac 243
gabrieltetar 24:1a13c998c7ac 244 while(strat_etat_s==TEST_DIVE) {
gabrieltetar 24:1a13c998c7ac 245 canProcessRx();
gabrieltetar 24:1a13c998c7ac 246 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 247 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 24:1a13c998c7ac 248 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 249 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Coordonnees", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 250 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 24:1a13c998c7ac 251 sprintf(toto,"%hd",x_robot);
gabrieltetar 24:1a13c998c7ac 252 lcd.DisplayStringAt(0, LINE(10), (unsigned char *)"X :", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 253 lcd.DisplayStringAt(50, LINE(10), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 254 sprintf(toto,"%hd",y_robot);
gabrieltetar 24:1a13c998c7ac 255 lcd.DisplayStringAt(0, LINE(11), (unsigned char *)"Y :", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 256 lcd.DisplayStringAt(50, LINE(11), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 257 sprintf(toto,"%hd",theta_robot);
gabrieltetar 24:1a13c998c7ac 258 lcd.DisplayStringAt(0, LINE(12), (unsigned char *)"T :", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 259 lcd.DisplayStringAt(50, LINE(12), (unsigned char *) toto, LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 260 if(RETOUR.Touched()) {
gabrieltetar 24:1a13c998c7ac 261 while (RETOUR.Touched());
gabrieltetar 24:1a13c998c7ac 262 strat_etat_s=DEMO2;
gabrieltetar 24:1a13c998c7ac 263 }
gabrieltetar 24:1a13c998c7ac 264 wait(0.2);
gabrieltetar 24:1a13c998c7ac 265 }
gabrieltetar 24:1a13c998c7ac 266 break;
gabrieltetar 21:d137ec53c3a9 267
gabrieltetar 21:d137ec53c3a9 268 case TEST_VENTOUSE:
goldmas 34:c314feaa0d3e 269 char vent_select_0 = 7, vent_select_1 = 0, vent_select_2 = 0, vent_select_3 = 0, vent_select_4 = 0, vent_select_5 = 0 ;
goldmas 34:c314feaa0d3e 270 unsigned char choix_vent;
gabrieltetar 21:d137ec53c3a9 271 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 272 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 273 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 274 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 275 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Ventouse", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 276 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 277 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 278 RETOUR.Draw(0xFFFF0000,0);
goldmas 34:c314feaa0d3e 279 TEST_ATTRAPER.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 280 TEST_RELACHER.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 281 TEST_VENT_0.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 282 TEST_VENT_1.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 283 TEST_VENT_2.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 284 TEST_VENT_3.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 285 TEST_VENT_4.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 286 TEST_VENT_5.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 287 while(strat_etat_s==TEST_VENTOUSE)
goldmas 34:c314feaa0d3e 288 {
goldmas 34:c314feaa0d3e 289 if(RETOUR.Touched())
goldmas 34:c314feaa0d3e 290 {
goldmas 34:c314feaa0d3e 291 while (RETOUR.Touched());
goldmas 34:c314feaa0d3e 292 strat_etat_s=DEMO;
goldmas 34:c314feaa0d3e 293 }
goldmas 34:c314feaa0d3e 294 else if(TEST_VENT_0.Touched())
goldmas 34:c314feaa0d3e 295 {
goldmas 34:c314feaa0d3e 296 while (TEST_VENT_0.Touched());
goldmas 34:c314feaa0d3e 297 if(vent_select_0 == 0)
goldmas 34:c314feaa0d3e 298 {
goldmas 34:c314feaa0d3e 299 vent_select_0 = 7 ;
goldmas 34:c314feaa0d3e 300 TEST_VENT_0.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 301 }
goldmas 34:c314feaa0d3e 302 else
goldmas 34:c314feaa0d3e 303 {
goldmas 34:c314feaa0d3e 304 vent_select_0 = 0 ;
goldmas 34:c314feaa0d3e 305 TEST_VENT_0.Draw(DIY_GREY, BLANC);
goldmas 34:c314feaa0d3e 306 }
goldmas 34:c314feaa0d3e 307 }
goldmas 34:c314feaa0d3e 308 else if(TEST_VENT_1.Touched())
goldmas 34:c314feaa0d3e 309 {
goldmas 34:c314feaa0d3e 310 while (TEST_VENT_1.Touched());
goldmas 34:c314feaa0d3e 311 if(vent_select_1 == 1)
goldmas 34:c314feaa0d3e 312 {
goldmas 34:c314feaa0d3e 313 vent_select_1 = 0 ;
goldmas 34:c314feaa0d3e 314 TEST_VENT_1.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 315 }
goldmas 34:c314feaa0d3e 316 else
goldmas 34:c314feaa0d3e 317 {
goldmas 34:c314feaa0d3e 318 vent_select_1 = 1 ;
goldmas 34:c314feaa0d3e 319 TEST_VENT_1.Draw(DIY_GREY, BLANC);
goldmas 34:c314feaa0d3e 320 }
goldmas 34:c314feaa0d3e 321 }
goldmas 34:c314feaa0d3e 322 else if(TEST_VENT_2.Touched())
goldmas 34:c314feaa0d3e 323 {
goldmas 34:c314feaa0d3e 324 while (TEST_VENT_2.Touched());
goldmas 34:c314feaa0d3e 325 if(vent_select_2 == 2)
goldmas 34:c314feaa0d3e 326 {
goldmas 34:c314feaa0d3e 327 vent_select_2 = 0 ;
goldmas 34:c314feaa0d3e 328 TEST_VENT_2.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 329 }
goldmas 34:c314feaa0d3e 330 else
goldmas 34:c314feaa0d3e 331 {
goldmas 34:c314feaa0d3e 332 vent_select_2 = 2 ;
goldmas 34:c314feaa0d3e 333 TEST_VENT_2.Draw(DIY_GREY, BLANC);
goldmas 34:c314feaa0d3e 334 }
goldmas 34:c314feaa0d3e 335 }
goldmas 34:c314feaa0d3e 336 else if(TEST_VENT_3.Touched())
goldmas 34:c314feaa0d3e 337 {
goldmas 34:c314feaa0d3e 338 while (TEST_VENT_3.Touched());
goldmas 34:c314feaa0d3e 339 if(vent_select_3 == 3)
goldmas 34:c314feaa0d3e 340 {
goldmas 34:c314feaa0d3e 341 vent_select_3 = 0 ;
goldmas 34:c314feaa0d3e 342 TEST_VENT_3.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 343 }
goldmas 34:c314feaa0d3e 344 else
goldmas 34:c314feaa0d3e 345 {
goldmas 34:c314feaa0d3e 346 vent_select_3 = 3 ;
goldmas 34:c314feaa0d3e 347 TEST_VENT_3.Draw(DIY_GREY, BLANC);
goldmas 34:c314feaa0d3e 348 }
goldmas 34:c314feaa0d3e 349 }
goldmas 34:c314feaa0d3e 350 else if(TEST_VENT_4.Touched())
goldmas 34:c314feaa0d3e 351 {
goldmas 34:c314feaa0d3e 352 while (TEST_VENT_4.Touched());
goldmas 34:c314feaa0d3e 353 if(vent_select_4 == 4)
goldmas 34:c314feaa0d3e 354 {
goldmas 34:c314feaa0d3e 355 vent_select_4 = 0 ;
goldmas 34:c314feaa0d3e 356 TEST_VENT_4.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 357 }
goldmas 34:c314feaa0d3e 358 else
goldmas 34:c314feaa0d3e 359 {
goldmas 34:c314feaa0d3e 360 vent_select_4 = 4 ;
goldmas 34:c314feaa0d3e 361 TEST_VENT_4.Draw(DIY_GREY, BLANC);
goldmas 34:c314feaa0d3e 362 }
goldmas 34:c314feaa0d3e 363 }
goldmas 34:c314feaa0d3e 364 else if(TEST_VENT_5.Touched())
goldmas 34:c314feaa0d3e 365 {
goldmas 34:c314feaa0d3e 366 while (TEST_VENT_5.Touched());
goldmas 34:c314feaa0d3e 367 if(vent_select_5 == 5)
goldmas 34:c314feaa0d3e 368 {
goldmas 34:c314feaa0d3e 369 vent_select_5 = 0 ;
goldmas 34:c314feaa0d3e 370 TEST_VENT_5.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 371 }
goldmas 34:c314feaa0d3e 372 else
goldmas 34:c314feaa0d3e 373 {
goldmas 34:c314feaa0d3e 374 vent_select_5 = 5 ;
goldmas 34:c314feaa0d3e 375 TEST_VENT_5.Draw(DIY_GREY, BLANC);
goldmas 34:c314feaa0d3e 376 }
goldmas 34:c314feaa0d3e 377 }
goldmas 34:c314feaa0d3e 378 else if (TEST_ATTRAPER.Touched())
goldmas 34:c314feaa0d3e 379 {
goldmas 34:c314feaa0d3e 380 while(TEST_ATTRAPER.Touched()) ;
goldmas 34:c314feaa0d3e 381 unsigned char message_droit_at, message_gauche_at, nombre_de_chiffre_droite, nombre_de_chiffre_gauche; //chager pour un short et remettre les valeurs correct (char utiliser pour les test)
goldmas 34:c314feaa0d3e 382 message_droit_at = 100 * vent_select_2 + 10 * vent_select_1 + vent_select_0 ;
goldmas 34:c314feaa0d3e 383 message_gauche_at = 100 * vent_select_5 + 10 * vent_select_4 + vent_select_3 ;
goldmas 34:c314feaa0d3e 384
goldmas 34:c314feaa0d3e 385 switch (message_gauche_at)
goldmas 34:c314feaa0d3e 386 {
goldmas 34:c314feaa0d3e 387 case 31 : //on dépasse la taille d'un char donc on met la valeur en comptant le dépassement
goldmas 34:c314feaa0d3e 388 choix_vent = 66 ;
goldmas 34:c314feaa0d3e 389 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 390 break ;
goldmas 34:c314feaa0d3e 391 case 28 : //on dépasse la taille d'un char donc on met la valeur en comptant le dépassement
goldmas 34:c314feaa0d3e 392 choix_vent = 54 ;
goldmas 34:c314feaa0d3e 393 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 394 break ;
goldmas 34:c314feaa0d3e 395 case 247 : //on dépasse la taille d'un char donc on met la valeur en comptant le dépassement
goldmas 34:c314feaa0d3e 396 choix_vent = 53 ;
goldmas 34:c314feaa0d3e 397 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 398 break ;
goldmas 34:c314feaa0d3e 399 case 43 :
goldmas 34:c314feaa0d3e 400 choix_vent = 43 ;
goldmas 34:c314feaa0d3e 401 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 402 break ;
goldmas 34:c314feaa0d3e 403 case 244 : //on dépasse la taille d'un char donc on met la valeur en comptant le dépassement
goldmas 34:c314feaa0d3e 404 choix_vent = 5 ;
goldmas 34:c314feaa0d3e 405 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 406 break ;
goldmas 34:c314feaa0d3e 407 case 40 :
goldmas 34:c314feaa0d3e 408 choix_vent = 4 ;
goldmas 34:c314feaa0d3e 409 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 410 break ;
goldmas 34:c314feaa0d3e 411 case 3 :
goldmas 34:c314feaa0d3e 412 choix_vent = 3 ;
goldmas 34:c314feaa0d3e 413 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 414 break ;
goldmas 34:c314feaa0d3e 415 }
goldmas 34:c314feaa0d3e 416
goldmas 34:c314feaa0d3e 417 switch (message_droit_at)
goldmas 34:c314feaa0d3e 418 {
goldmas 34:c314feaa0d3e 419 case 210 :
goldmas 34:c314feaa0d3e 420 choix_vent = 210 ;
goldmas 34:c314feaa0d3e 421 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 422 break ;
goldmas 34:c314feaa0d3e 423 case 217 :
goldmas 34:c314feaa0d3e 424 choix_vent = 21 ;
goldmas 34:c314feaa0d3e 425 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 426 break ;
goldmas 34:c314feaa0d3e 427 case 200 :
goldmas 34:c314feaa0d3e 428 choix_vent = 20 ;
goldmas 34:c314feaa0d3e 429 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 430 break ;
goldmas 34:c314feaa0d3e 431 case 10 :
goldmas 34:c314feaa0d3e 432 choix_vent = 10 ;
goldmas 34:c314feaa0d3e 433 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 434 break ;
goldmas 34:c314feaa0d3e 435 case 207 :
goldmas 34:c314feaa0d3e 436 choix_vent = 2 ;
goldmas 34:c314feaa0d3e 437 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 438 break ;
goldmas 34:c314feaa0d3e 439 case 17 :
goldmas 34:c314feaa0d3e 440 choix_vent = 1 ;
goldmas 34:c314feaa0d3e 441 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 442 break ;
goldmas 34:c314feaa0d3e 443 case 0 :
goldmas 34:c314feaa0d3e 444 choix_vent = 0 ;
goldmas 34:c314feaa0d3e 445 SendMsgCan(VENT_AT, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 446 break ;
goldmas 34:c314feaa0d3e 447 }
goldmas 34:c314feaa0d3e 448
goldmas 34:c314feaa0d3e 449 message_droit_at = 0 ;
goldmas 34:c314feaa0d3e 450 message_gauche_at = 0 ;
goldmas 34:c314feaa0d3e 451
goldmas 34:c314feaa0d3e 452 TEST_ATTRAPER.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 453 }
goldmas 34:c314feaa0d3e 454 else if (TEST_RELACHER.Touched())
goldmas 34:c314feaa0d3e 455 {
goldmas 34:c314feaa0d3e 456 while(TEST_RELACHER.Touched());
goldmas 34:c314feaa0d3e 457 unsigned char message_droit_re, message_gauche_re;
goldmas 34:c314feaa0d3e 458 message_droit_re = 100 * vent_select_2 + 10 * vent_select_1 + vent_select_0 ;
goldmas 34:c314feaa0d3e 459 message_gauche_re = 100 * vent_select_5 + 10 * vent_select_4 + vent_select_3 ;
goldmas 34:c314feaa0d3e 460 switch (message_droit_re)
goldmas 34:c314feaa0d3e 461 {
goldmas 34:c314feaa0d3e 462 case 210 :
goldmas 34:c314feaa0d3e 463 choix_vent = 210 ;
goldmas 34:c314feaa0d3e 464 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 465 break ;
goldmas 34:c314feaa0d3e 466 case 217 :
goldmas 34:c314feaa0d3e 467 choix_vent = 21 ;
goldmas 34:c314feaa0d3e 468 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 469 break ;
goldmas 34:c314feaa0d3e 470 case 200 :
goldmas 34:c314feaa0d3e 471 choix_vent = 20 ;
goldmas 34:c314feaa0d3e 472 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 473 break ;
goldmas 34:c314feaa0d3e 474 case 10 :
goldmas 34:c314feaa0d3e 475 choix_vent = 10 ;
goldmas 34:c314feaa0d3e 476 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 477 break ;
goldmas 34:c314feaa0d3e 478 case 207 :
goldmas 34:c314feaa0d3e 479 choix_vent = 2 ;
goldmas 34:c314feaa0d3e 480 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 481 break ;
goldmas 34:c314feaa0d3e 482 case 17 :
goldmas 34:c314feaa0d3e 483 choix_vent = 1 ;
goldmas 34:c314feaa0d3e 484 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 485 break ;
goldmas 34:c314feaa0d3e 486 case 0 :
goldmas 34:c314feaa0d3e 487 choix_vent = 0 ;
goldmas 34:c314feaa0d3e 488 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 489 break ;
goldmas 34:c314feaa0d3e 490 }
goldmas 34:c314feaa0d3e 491
goldmas 34:c314feaa0d3e 492 switch (message_gauche_re)
goldmas 34:c314feaa0d3e 493 {
goldmas 34:c314feaa0d3e 494 case 31 :
goldmas 34:c314feaa0d3e 495 choix_vent = 66 ;
goldmas 34:c314feaa0d3e 496 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 497 break ;
goldmas 34:c314feaa0d3e 498 case 28 :
goldmas 34:c314feaa0d3e 499 choix_vent = 54 ;
goldmas 34:c314feaa0d3e 500 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 501 break ;
goldmas 34:c314feaa0d3e 502 case 247 :
goldmas 34:c314feaa0d3e 503 choix_vent = 53 ;
goldmas 34:c314feaa0d3e 504 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 505 break ;
goldmas 34:c314feaa0d3e 506 case 43 :
goldmas 34:c314feaa0d3e 507 choix_vent = 43 ;
goldmas 34:c314feaa0d3e 508 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 509 break ;
goldmas 34:c314feaa0d3e 510 case 244 :
goldmas 34:c314feaa0d3e 511 choix_vent = 5 ;
goldmas 34:c314feaa0d3e 512 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 513 break ;
goldmas 34:c314feaa0d3e 514 case 40 :
goldmas 34:c314feaa0d3e 515 choix_vent = 4 ;
goldmas 34:c314feaa0d3e 516 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 517 break ;
goldmas 34:c314feaa0d3e 518 case 3 :
goldmas 34:c314feaa0d3e 519 choix_vent = 3 ;
goldmas 34:c314feaa0d3e 520 SendMsgCan(VENT_RE, &choix_vent,sizeof(choix_vent));
goldmas 34:c314feaa0d3e 521 break ;
goldmas 34:c314feaa0d3e 522 }
goldmas 34:c314feaa0d3e 523 message_droit_re = 0 ;
goldmas 34:c314feaa0d3e 524 message_gauche_re = 0 ; //on remet les variables de calcul à 0 pour qu'on puisse recalculer correctement
goldmas 34:c314feaa0d3e 525
goldmas 34:c314feaa0d3e 526 TEST_RELACHER.Draw(BLEU, BLANC);
goldmas 34:c314feaa0d3e 527
goldmas 34:c314feaa0d3e 528 }
goldmas 34:c314feaa0d3e 529 }
goldmas 34:c314feaa0d3e 530 break;
goldmas 34:c314feaa0d3e 531
goldmas 34:c314feaa0d3e 532 /*
gabrieltetar 21:d137ec53c3a9 533 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 534 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 535 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 536 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 537 while(strat_etat_s==TEST_VENTOUSE) {
gabrieltetar 21:d137ec53c3a9 538 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 539 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 540 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 541 } else if(TEST_A.Touched()) {
gabrieltetar 21:d137ec53c3a9 542 while (TEST_A.Touched());
maximilienlv 28:7f2990747e09 543 SendRawId(VENT_ETAT);
gabrieltetar 21:d137ec53c3a9 544 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 545 } else if(TEST_NUM.Touched()) {
gabrieltetar 21:d137ec53c3a9 546 while (TEST_NUM.Touched());
gabrieltetar 21:d137ec53c3a9 547 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 548 switch(maximilien){
gabrieltetar 21:d137ec53c3a9 549 case 1:
goldmas 32:7f8e3ee2adac 550 choix_groupe = 0 ;
goldmas 32:7f8e3ee2adac 551 SendMsgCan(VENT_AT, &choix_groupe, sizeof(choix_groupe)) ;
gabrieltetar 21:d137ec53c3a9 552 break;
gabrieltetar 21:d137ec53c3a9 553 case 2:
goldmas 32:7f8e3ee2adac 554 choix_groupe = 0 ;
goldmas 32:7f8e3ee2adac 555 SendMsgCan(VENT_RE, &choix_groupe, sizeof(choix_groupe)) ;
gabrieltetar 21:d137ec53c3a9 556 break;
gabrieltetar 21:d137ec53c3a9 557 case 3:
goldmas 32:7f8e3ee2adac 558 choix_groupe = 1 ;
goldmas 32:7f8e3ee2adac 559 SendMsgCan(VENT_AT, &choix_groupe, sizeof(choix_groupe)) ;
gabrieltetar 21:d137ec53c3a9 560 break;
gabrieltetar 21:d137ec53c3a9 561 case 4:
goldmas 32:7f8e3ee2adac 562 choix_groupe = 1 ;
goldmas 32:7f8e3ee2adac 563 SendMsgCan(VENT_RE, &choix_groupe, sizeof(choix_groupe)) ;
gabrieltetar 21:d137ec53c3a9 564 break;
gabrieltetar 21:d137ec53c3a9 565 case 5:
goldmas 32:7f8e3ee2adac 566 choix_groupe = 2 ;
goldmas 32:7f8e3ee2adac 567 SendMsgCan(VENT_AT, &choix_groupe, sizeof(choix_groupe)) ;
gabrieltetar 21:d137ec53c3a9 568 break;
gabrieltetar 21:d137ec53c3a9 569 case 6:
goldmas 32:7f8e3ee2adac 570 choix_groupe = 2 ;
goldmas 32:7f8e3ee2adac 571 SendMsgCan(VENT_RE, &choix_groupe, sizeof(choix_groupe)) ;
goldmas 32:7f8e3ee2adac 572 break;
goldmas 32:7f8e3ee2adac 573 case 7:
goldmas 32:7f8e3ee2adac 574 choix_groupe = 3 ;
goldmas 32:7f8e3ee2adac 575 SendMsgCan(VENT_AT, &choix_groupe, sizeof(choix_groupe)) ;
goldmas 32:7f8e3ee2adac 576 break;
goldmas 32:7f8e3ee2adac 577 case 8:
goldmas 32:7f8e3ee2adac 578 choix_groupe = 3 ;
goldmas 32:7f8e3ee2adac 579 SendMsgCan(VENT_RE, &choix_groupe, sizeof(choix_groupe)) ;
goldmas 32:7f8e3ee2adac 580 break;
goldmas 32:7f8e3ee2adac 581 case 9:
goldmas 32:7f8e3ee2adac 582 choix_groupe = 4 ;
goldmas 32:7f8e3ee2adac 583 SendMsgCan(VENT_AT, &choix_groupe, sizeof(choix_groupe)) ;
goldmas 32:7f8e3ee2adac 584 break;
goldmas 32:7f8e3ee2adac 585 case 10:
goldmas 32:7f8e3ee2adac 586 choix_groupe = 4 ;
goldmas 32:7f8e3ee2adac 587 SendMsgCan(VENT_RE, &choix_groupe, sizeof(choix_groupe)) ;
goldmas 32:7f8e3ee2adac 588 break;
goldmas 32:7f8e3ee2adac 589 case 11:
goldmas 32:7f8e3ee2adac 590 choix_groupe = 5 ;
goldmas 32:7f8e3ee2adac 591 SendMsgCan(VENT_AT, &choix_groupe, sizeof(choix_groupe)) ;
goldmas 32:7f8e3ee2adac 592 break;
goldmas 32:7f8e3ee2adac 593 case 12:
goldmas 32:7f8e3ee2adac 594 choix_groupe = 5 ;
goldmas 32:7f8e3ee2adac 595 SendMsgCan(VENT_RE, &choix_groupe, sizeof(choix_groupe)) ;
gabrieltetar 21:d137ec53c3a9 596 break;
gabrieltetar 21:d137ec53c3a9 597 }
gabrieltetar 21:d137ec53c3a9 598 } else if(TEST_PLUS.Touched()) {
gabrieltetar 21:d137ec53c3a9 599 while (TEST_PLUS.Touched());
gabrieltetar 21:d137ec53c3a9 600 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 601 if(maximilien!=6)maximilien++;
gabrieltetar 21:d137ec53c3a9 602 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 603 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 604 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 605 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 606 } else if(TEST_MOINS.Touched()) {
gabrieltetar 21:d137ec53c3a9 607 while (TEST_MOINS.Touched());
gabrieltetar 21:d137ec53c3a9 608 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 609 if(maximilien!=1)maximilien--;
gabrieltetar 21:d137ec53c3a9 610 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 611 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 612 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 613 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 614 }
gabrieltetar 21:d137ec53c3a9 615 }
goldmas 34:c314feaa0d3e 616 break;*/
gabrieltetar 21:d137ec53c3a9 617
gabrieltetar 24:1a13c998c7ac 618 case TEST_ELECTROV:
gabrieltetar 21:d137ec53c3a9 619 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 620 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 621 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 622 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 623 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"A : Manches B : Pavillon", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 624 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 625 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 626 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 627 while(strat_etat_s==TEST_ELECTROV) {
gabrieltetar 21:d137ec53c3a9 628 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 629 while (RETOUR.Touched());
gabrieltetar 24:1a13c998c7ac 630 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 631 } else if(TEST_A.Touched()) {
gabrieltetar 21:d137ec53c3a9 632 while (TEST_A.Touched());
gabrieltetar 21:d137ec53c3a9 633 //SendRawId(TEST_ELECTROV_A);
gabrieltetar 21:d137ec53c3a9 634 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 635 } else if(TEST_B.Touched()) {
gabrieltetar 21:d137ec53c3a9 636 while (TEST_B.Touched());
gabrieltetar 21:d137ec53c3a9 637 //SendRawId(TEST_ELECTROV_A);
gabrieltetar 21:d137ec53c3a9 638 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 639 }
gabrieltetar 21:d137ec53c3a9 640 }
gabrieltetar 21:d137ec53c3a9 641 break;
gabrieltetar 24:1a13c998c7ac 642
gabrieltetar 21:d137ec53c3a9 643 case TEST_AUD:
gabrieltetar 21:d137ec53c3a9 644
gabrieltetar 21:d137ec53c3a9 645 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 646 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 647 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 648 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 649 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Audio", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 650 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 651 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 652 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 653 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 654 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 655 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 656 while(strat_etat_s==TEST_AUD) {
gabrieltetar 21:d137ec53c3a9 657 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 658 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 659 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 660 } else if(TEST_NUM.Touched()) {
gabrieltetar 21:d137ec53c3a9 661 while (TEST_NUM.Touched());
gabrieltetar 21:d137ec53c3a9 662 TEST_NUM.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 663 Debug_Audio(3,maximilien);
gabrieltetar 21:d137ec53c3a9 664 } else if(TEST_PLUS.Touched()) {
gabrieltetar 21:d137ec53c3a9 665 while (TEST_PLUS.Touched());
gabrieltetar 21:d137ec53c3a9 666 TEST_PLUS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 667 if(maximilien!=20)maximilien++;
gabrieltetar 21:d137ec53c3a9 668 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 669 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 670 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 671 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 672 } else if(TEST_MOINS.Touched()) {
gabrieltetar 21:d137ec53c3a9 673 while (TEST_MOINS.Touched());
gabrieltetar 21:d137ec53c3a9 674 TEST_MOINS.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 675 if(maximilien!=1)maximilien--;
gabrieltetar 21:d137ec53c3a9 676 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 677 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 678 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 679 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 680 }
gabrieltetar 21:d137ec53c3a9 681 }
gabrieltetar 21:d137ec53c3a9 682 break;
gabrieltetar 21:d137ec53c3a9 683
gabrieltetar 21:d137ec53c3a9 684 case TEST_SERVO_BRAS:
goldmas 33:c54841d11156 685 char bras_select_0 = 7, bras_select_1 = 0, bras_select_2 = 0, bras_select_3 = 0, bras_select_4 = 0, bras_select_5 = 0 ;
goldmas 33:c54841d11156 686 unsigned char choix_bras;
gabrieltetar 21:d137ec53c3a9 687 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 688 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 689 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 690 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 691 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Bras", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 692 sprintf(toto,"%hd",maximilien);
gabrieltetar 21:d137ec53c3a9 693 lcd.DisplayStringAt(50, LINE(20), (unsigned char *)toto, LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 694 RETOUR.Draw(0xFFFF0000,0);
goldmas 32:7f8e3ee2adac 695 TEST_ATTRAPER.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 696 TEST_RELACHER.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 697 TEST_SERVO_0.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 698 TEST_SERVO_1.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 699 TEST_SERVO_2.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 700 TEST_SERVO_3.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 701 TEST_SERVO_4.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 702 TEST_SERVO_5.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 703 while(strat_etat_s==TEST_SERVO_BRAS)
goldmas 32:7f8e3ee2adac 704 {
goldmas 32:7f8e3ee2adac 705 if(RETOUR.Touched())
goldmas 32:7f8e3ee2adac 706 {
gabrieltetar 21:d137ec53c3a9 707 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 708 strat_etat_s=DEMO;
goldmas 32:7f8e3ee2adac 709 }
goldmas 32:7f8e3ee2adac 710 else if(TEST_SERVO_0.Touched())
goldmas 32:7f8e3ee2adac 711 {
goldmas 32:7f8e3ee2adac 712 while (TEST_SERVO_0.Touched());
goldmas 33:c54841d11156 713 if(bras_select_0 == 0)
goldmas 33:c54841d11156 714 {
goldmas 33:c54841d11156 715 bras_select_0 = 7 ;
goldmas 33:c54841d11156 716 TEST_SERVO_0.Draw(BLEU, BLANC);
goldmas 33:c54841d11156 717 }
goldmas 33:c54841d11156 718 else
goldmas 32:7f8e3ee2adac 719 {
goldmas 32:7f8e3ee2adac 720 bras_select_0 = 0 ;
goldmas 32:7f8e3ee2adac 721 TEST_SERVO_0.Draw(DIY_GREY, BLANC);
goldmas 32:7f8e3ee2adac 722 }
goldmas 32:7f8e3ee2adac 723 }
goldmas 32:7f8e3ee2adac 724 else if(TEST_SERVO_1.Touched())
goldmas 32:7f8e3ee2adac 725 {
goldmas 32:7f8e3ee2adac 726 while (TEST_SERVO_1.Touched());
goldmas 33:c54841d11156 727 if(bras_select_1 == 1)
goldmas 32:7f8e3ee2adac 728 {
goldmas 32:7f8e3ee2adac 729 bras_select_1 = 0 ;
goldmas 33:c54841d11156 730 TEST_SERVO_1.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 731 }
goldmas 32:7f8e3ee2adac 732 else
goldmas 32:7f8e3ee2adac 733 {
goldmas 32:7f8e3ee2adac 734 bras_select_1 = 1 ;
goldmas 33:c54841d11156 735 TEST_SERVO_1.Draw(DIY_GREY, BLANC);
goldmas 32:7f8e3ee2adac 736 }
goldmas 32:7f8e3ee2adac 737 }
goldmas 32:7f8e3ee2adac 738 else if(TEST_SERVO_2.Touched())
goldmas 32:7f8e3ee2adac 739 {
goldmas 32:7f8e3ee2adac 740 while (TEST_SERVO_2.Touched());
goldmas 33:c54841d11156 741 if(bras_select_2 == 2)
goldmas 32:7f8e3ee2adac 742 {
goldmas 32:7f8e3ee2adac 743 bras_select_2 = 0 ;
goldmas 33:c54841d11156 744 TEST_SERVO_2.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 745 }
goldmas 32:7f8e3ee2adac 746 else
goldmas 32:7f8e3ee2adac 747 {
goldmas 33:c54841d11156 748 bras_select_2 = 2 ;
goldmas 33:c54841d11156 749 TEST_SERVO_2.Draw(DIY_GREY, BLANC);
gabrieltetar 21:d137ec53c3a9 750 }
goldmas 32:7f8e3ee2adac 751 }
goldmas 32:7f8e3ee2adac 752 else if(TEST_SERVO_3.Touched())
goldmas 32:7f8e3ee2adac 753 {
goldmas 32:7f8e3ee2adac 754 while (TEST_SERVO_3.Touched());
goldmas 33:c54841d11156 755 if(bras_select_3 == 3)
goldmas 32:7f8e3ee2adac 756 {
goldmas 32:7f8e3ee2adac 757 bras_select_3 = 0 ;
goldmas 33:c54841d11156 758 TEST_SERVO_3.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 759 }
goldmas 32:7f8e3ee2adac 760 else
goldmas 32:7f8e3ee2adac 761 {
goldmas 33:c54841d11156 762 bras_select_3 = 3 ;
goldmas 33:c54841d11156 763 TEST_SERVO_3.Draw(DIY_GREY, BLANC);
goldmas 32:7f8e3ee2adac 764 }
goldmas 32:7f8e3ee2adac 765 }
goldmas 32:7f8e3ee2adac 766 else if(TEST_SERVO_4.Touched())
goldmas 32:7f8e3ee2adac 767 {
goldmas 32:7f8e3ee2adac 768 while (TEST_SERVO_4.Touched());
goldmas 33:c54841d11156 769 if(bras_select_4 == 4)
goldmas 32:7f8e3ee2adac 770 {
goldmas 32:7f8e3ee2adac 771 bras_select_4 = 0 ;
goldmas 33:c54841d11156 772 TEST_SERVO_4.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 773 }
goldmas 32:7f8e3ee2adac 774 else
goldmas 32:7f8e3ee2adac 775 {
goldmas 33:c54841d11156 776 bras_select_4 = 4 ;
goldmas 33:c54841d11156 777 TEST_SERVO_4.Draw(DIY_GREY, BLANC);
goldmas 32:7f8e3ee2adac 778 }
goldmas 32:7f8e3ee2adac 779 }
goldmas 32:7f8e3ee2adac 780 else if(TEST_SERVO_5.Touched())
goldmas 32:7f8e3ee2adac 781 {
goldmas 32:7f8e3ee2adac 782 while (TEST_SERVO_5.Touched());
goldmas 33:c54841d11156 783 if(bras_select_5 == 5)
goldmas 32:7f8e3ee2adac 784 {
goldmas 32:7f8e3ee2adac 785 bras_select_5 = 0 ;
goldmas 33:c54841d11156 786 TEST_SERVO_5.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 787 }
goldmas 32:7f8e3ee2adac 788 else
goldmas 32:7f8e3ee2adac 789 {
goldmas 33:c54841d11156 790 bras_select_5 = 5 ;
goldmas 33:c54841d11156 791 TEST_SERVO_5.Draw(DIY_GREY, BLANC);
goldmas 32:7f8e3ee2adac 792 }
goldmas 32:7f8e3ee2adac 793 }
goldmas 32:7f8e3ee2adac 794 else if (TEST_ATTRAPER.Touched())
goldmas 32:7f8e3ee2adac 795 {
goldmas 33:c54841d11156 796 while(TEST_ATTRAPER.Touched()) ;
goldmas 33:c54841d11156 797 unsigned char message_droit_at, message_gauche_at, nombre_de_chiffre_droite, nombre_de_chiffre_gauche;
goldmas 33:c54841d11156 798 message_droit_at = 100 * bras_select_2 + 10 * bras_select_1 + bras_select_0 ;
goldmas 33:c54841d11156 799 message_gauche_at = 100 * bras_select_5 + 10 * bras_select_4 + bras_select_3 ;
goldmas 33:c54841d11156 800
goldmas 33:c54841d11156 801 switch (message_gauche_at)
goldmas 33:c54841d11156 802 {
goldmas 33:c54841d11156 803 case 31 : //on dépasse la taille d'un char donc on met la valeur en comptant le dépassement
goldmas 33:c54841d11156 804 choix_bras = 66 ;
goldmas 33:c54841d11156 805 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 806 waitingAckFrom = 0;
goldmas 33:c54841d11156 807 waitingAckID =0;
goldmas 33:c54841d11156 808 break ;
goldmas 33:c54841d11156 809 case 28 : //on dépasse la taille d'un char donc on met la valeur en comptant le dépassement
goldmas 33:c54841d11156 810 choix_bras = 54 ;
goldmas 33:c54841d11156 811 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 812 waitingAckFrom = 0;
goldmas 33:c54841d11156 813 waitingAckID =0;
goldmas 33:c54841d11156 814 break ;
goldmas 33:c54841d11156 815 case 247 : //on dépasse la taille d'un char donc on met la valeur en comptant le dépassement
goldmas 33:c54841d11156 816 choix_bras = 53 ;
goldmas 33:c54841d11156 817 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 818 waitingAckFrom = 0;
goldmas 33:c54841d11156 819 waitingAckID =0;
goldmas 33:c54841d11156 820 break ;
goldmas 33:c54841d11156 821 case 43 :
goldmas 33:c54841d11156 822 choix_bras = 43 ;
goldmas 33:c54841d11156 823 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 824 waitingAckFrom = 0;
goldmas 33:c54841d11156 825 waitingAckID =0;
goldmas 33:c54841d11156 826 break ;
goldmas 33:c54841d11156 827 case 244 : //on dépasse la taille d'un char donc on met la valeur en comptant le dépassement
goldmas 33:c54841d11156 828 choix_bras = 5 ;
goldmas 33:c54841d11156 829 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 830 waitingAckFrom = 0;
goldmas 33:c54841d11156 831 waitingAckID =0;
goldmas 33:c54841d11156 832 break ;
goldmas 33:c54841d11156 833 case 40 :
goldmas 33:c54841d11156 834 choix_bras = 4 ;
goldmas 33:c54841d11156 835 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 836 waitingAckFrom = 0;
goldmas 33:c54841d11156 837 waitingAckID =0;
goldmas 33:c54841d11156 838 break ;
goldmas 33:c54841d11156 839 case 3 :
goldmas 33:c54841d11156 840 choix_bras = 3 ;
goldmas 33:c54841d11156 841 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 842 waitingAckFrom = 0;
goldmas 33:c54841d11156 843 waitingAckID =0;
goldmas 33:c54841d11156 844 break ;
goldmas 33:c54841d11156 845 }
goldmas 33:c54841d11156 846
goldmas 33:c54841d11156 847 switch (message_droit_at)
goldmas 33:c54841d11156 848 {
goldmas 33:c54841d11156 849 case 210 :
goldmas 33:c54841d11156 850 choix_bras = 210 ;
goldmas 33:c54841d11156 851 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 852 waitingAckFrom = 0;
goldmas 33:c54841d11156 853 waitingAckID =0;
goldmas 33:c54841d11156 854 break ;
goldmas 33:c54841d11156 855 case 217 :
goldmas 33:c54841d11156 856 choix_bras = 21 ;
goldmas 33:c54841d11156 857 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 858 waitingAckFrom = 0;
goldmas 33:c54841d11156 859 waitingAckID =0;
goldmas 33:c54841d11156 860 break ;
goldmas 33:c54841d11156 861 case 200 :
goldmas 33:c54841d11156 862 choix_bras = 20 ;
goldmas 33:c54841d11156 863 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 864 waitingAckFrom = 0;
goldmas 33:c54841d11156 865 waitingAckID =0;
goldmas 33:c54841d11156 866 break ;
goldmas 33:c54841d11156 867 case 10 :
goldmas 33:c54841d11156 868 choix_bras = 10 ;
goldmas 33:c54841d11156 869 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 870 waitingAckFrom = 0;
goldmas 33:c54841d11156 871 waitingAckID =0;
goldmas 33:c54841d11156 872 break ;
goldmas 33:c54841d11156 873 case 207 :
goldmas 33:c54841d11156 874 choix_bras = 2 ;
goldmas 33:c54841d11156 875 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 876 waitingAckFrom = 0;
goldmas 33:c54841d11156 877 waitingAckID =0;
goldmas 33:c54841d11156 878 break ;
goldmas 33:c54841d11156 879 case 17 :
goldmas 33:c54841d11156 880 choix_bras = 1 ;
goldmas 33:c54841d11156 881 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 882 waitingAckFrom = 0;
goldmas 33:c54841d11156 883 waitingAckID =0;
goldmas 33:c54841d11156 884 break ;
goldmas 33:c54841d11156 885 case 0 :
goldmas 33:c54841d11156 886 choix_bras = 0 ;
goldmas 33:c54841d11156 887 SendMsgCan(BRAS_AT, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 888 waitingAckFrom = 0;
goldmas 33:c54841d11156 889 waitingAckID =0;
goldmas 33:c54841d11156 890 break ;
goldmas 33:c54841d11156 891 }
goldmas 33:c54841d11156 892
goldmas 33:c54841d11156 893 message_droit_at = 0 ;
goldmas 33:c54841d11156 894 message_gauche_at = 0 ;
goldmas 33:c54841d11156 895
goldmas 33:c54841d11156 896 TEST_ATTRAPER.Draw(BLEU, BLANC);
goldmas 33:c54841d11156 897 }
goldmas 33:c54841d11156 898 else if (TEST_RELACHER.Touched())
goldmas 33:c54841d11156 899 {
goldmas 33:c54841d11156 900 while(TEST_RELACHER.Touched());
goldmas 33:c54841d11156 901 unsigned char message_droit_re, message_gauche_re;
goldmas 33:c54841d11156 902 message_droit_re = 100 * bras_select_2 + 10 * bras_select_1 + bras_select_0 ;
goldmas 33:c54841d11156 903 message_gauche_re = 100 * bras_select_5 + 10 * bras_select_4 + bras_select_3 ;
goldmas 33:c54841d11156 904 switch (message_droit_re)
goldmas 33:c54841d11156 905 {
goldmas 33:c54841d11156 906 case 210 :
goldmas 33:c54841d11156 907 choix_bras = 210 ;
goldmas 33:c54841d11156 908 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 909 waitingAckFrom = 0;
goldmas 33:c54841d11156 910 waitingAckID =0;
goldmas 33:c54841d11156 911 break ;
goldmas 33:c54841d11156 912 case 217 :
goldmas 33:c54841d11156 913 choix_bras = 21 ;
goldmas 33:c54841d11156 914 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 915 waitingAckFrom = 0;
goldmas 33:c54841d11156 916 waitingAckID =0;
goldmas 33:c54841d11156 917 break ;
goldmas 33:c54841d11156 918 case 200 :
goldmas 33:c54841d11156 919 choix_bras = 20 ;
goldmas 33:c54841d11156 920 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 921 waitingAckFrom = 0;
goldmas 33:c54841d11156 922 waitingAckID =0;
goldmas 33:c54841d11156 923 break ;
goldmas 33:c54841d11156 924 case 10 :
goldmas 33:c54841d11156 925 choix_bras = 10 ;
goldmas 33:c54841d11156 926 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 927 waitingAckFrom = 0;
goldmas 33:c54841d11156 928 waitingAckID =0;
goldmas 33:c54841d11156 929 break ;
goldmas 33:c54841d11156 930 case 207 :
goldmas 33:c54841d11156 931 choix_bras = 2 ;
goldmas 33:c54841d11156 932 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 933 waitingAckFrom = 0;
goldmas 33:c54841d11156 934 waitingAckID =0;
goldmas 33:c54841d11156 935 break ;
goldmas 33:c54841d11156 936 case 17 :
goldmas 33:c54841d11156 937 choix_bras = 1 ;
goldmas 33:c54841d11156 938 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 939 waitingAckFrom = 0;
goldmas 33:c54841d11156 940 waitingAckID =0;
goldmas 33:c54841d11156 941 break ;
goldmas 33:c54841d11156 942 case 0 :
goldmas 33:c54841d11156 943 choix_bras = 0 ;
goldmas 33:c54841d11156 944 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 945 waitingAckFrom = 0;
goldmas 33:c54841d11156 946 waitingAckID =0;
goldmas 33:c54841d11156 947 break ;
goldmas 33:c54841d11156 948 }
goldmas 33:c54841d11156 949
goldmas 33:c54841d11156 950 switch (message_gauche_re)
goldmas 33:c54841d11156 951 {
goldmas 33:c54841d11156 952 case 31 :
goldmas 33:c54841d11156 953 choix_bras = 66 ;
goldmas 33:c54841d11156 954 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 955 waitingAckFrom = 0;
goldmas 33:c54841d11156 956 waitingAckID =0;
goldmas 33:c54841d11156 957 break ;
goldmas 33:c54841d11156 958 case 28 :
goldmas 33:c54841d11156 959 choix_bras = 54 ;
goldmas 33:c54841d11156 960 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 961 waitingAckFrom = 0;
goldmas 33:c54841d11156 962 waitingAckID =0;
goldmas 33:c54841d11156 963 break ;
goldmas 33:c54841d11156 964 case 247 :
goldmas 33:c54841d11156 965 choix_bras = 53 ;
goldmas 33:c54841d11156 966 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 967 waitingAckFrom = 0;
goldmas 33:c54841d11156 968 waitingAckID =0;
goldmas 33:c54841d11156 969 break ;
goldmas 33:c54841d11156 970 case 43 :
goldmas 33:c54841d11156 971 choix_bras = 43 ;
goldmas 33:c54841d11156 972 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 973 waitingAckFrom = 0;
goldmas 33:c54841d11156 974 waitingAckID =0;
goldmas 33:c54841d11156 975 break ;
goldmas 33:c54841d11156 976 case 244 :
goldmas 33:c54841d11156 977 choix_bras = 5 ;
goldmas 33:c54841d11156 978 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 979 waitingAckFrom = 0;
goldmas 33:c54841d11156 980 waitingAckID =0;
goldmas 33:c54841d11156 981 break ;
goldmas 33:c54841d11156 982 case 40 :
goldmas 33:c54841d11156 983 choix_bras = 4 ;
goldmas 33:c54841d11156 984 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 985 waitingAckFrom = 0;
goldmas 33:c54841d11156 986 waitingAckID =0;
goldmas 33:c54841d11156 987 break ;
goldmas 33:c54841d11156 988 case 3 :
goldmas 33:c54841d11156 989 choix_bras = 3 ;
goldmas 33:c54841d11156 990 SendMsgCan(BRAS_RE, &choix_bras,sizeof(choix_bras));
goldmas 33:c54841d11156 991 waitingAckFrom = 0;
goldmas 33:c54841d11156 992 waitingAckID =0;
goldmas 33:c54841d11156 993 break ;
goldmas 33:c54841d11156 994 }
goldmas 33:c54841d11156 995 message_droit_re = 0 ;
goldmas 33:c54841d11156 996 message_gauche_re = 0 ;
goldmas 33:c54841d11156 997
goldmas 33:c54841d11156 998 TEST_RELACHER.Draw(BLEU, BLANC);
goldmas 32:7f8e3ee2adac 999
gabrieltetar 21:d137ec53c3a9 1000 }
gabrieltetar 21:d137ec53c3a9 1001 }
gabrieltetar 21:d137ec53c3a9 1002 break;
gabrieltetar 21:d137ec53c3a9 1003
gabrieltetar 21:d137ec53c3a9 1004 case TEST_COULEUR:
gabrieltetar 21:d137ec53c3a9 1005 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1006 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Couleur", LEFT_MODE);
gabrieltetar 24:1a13c998c7ac 1007 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 1008 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 1009 TEST_C.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 1010 TEST_D.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 1011 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 1012 while(strat_etat_s==TEST_COULEUR) {
gabrieltetar 21:d137ec53c3a9 1013 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 1014 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 1015 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 1016 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 24:1a13c998c7ac 1017 }else if(TEST_A.Touched()) {
gabrieltetar 24:1a13c998c7ac 1018 while (TEST_A.Touched());
gabrieltetar 24:1a13c998c7ac 1019 SendRawId(TEST_BRAS_A);
gabrieltetar 24:1a13c998c7ac 1020 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 1021 } else if(TEST_B.Touched()) {
gabrieltetar 24:1a13c998c7ac 1022 while (TEST_B.Touched());
gabrieltetar 24:1a13c998c7ac 1023 SendRawId(TEST_BRAS_B);
gabrieltetar 24:1a13c998c7ac 1024 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 1025 } else if(TEST_C.Touched()) {
gabrieltetar 24:1a13c998c7ac 1026 while (TEST_C.Touched());
gabrieltetar 24:1a13c998c7ac 1027 SendRawId(TEST_BRAS_C);
gabrieltetar 24:1a13c998c7ac 1028 TEST_C.Draw(BLEU, BLANC);
gabrieltetar 24:1a13c998c7ac 1029 } else if(TEST_D.Touched()) {
gabrieltetar 24:1a13c998c7ac 1030 while (TEST_D.Touched());
gabrieltetar 24:1a13c998c7ac 1031 SendRawId(TEST_BRAS_D);
gabrieltetar 24:1a13c998c7ac 1032 TEST_D.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 1033 }
gabrieltetar 21:d137ec53c3a9 1034 }
gabrieltetar 21:d137ec53c3a9 1035 break;
gabrieltetar 21:d137ec53c3a9 1036
gabrieltetar 21:d137ec53c3a9 1037 case TEST_MOTEUR:
gabrieltetar 21:d137ec53c3a9 1038 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1039 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 1040 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1041 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1042 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"Test Moteur", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1043 RETOUR.Draw(0xFFFF0000,0);
gabrieltetar 21:d137ec53c3a9 1044 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 1045 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 1046 while(strat_etat_s==TEST_MOTEUR) {
gabrieltetar 21:d137ec53c3a9 1047 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 1048 while (RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 1049 strat_etat_s=DEMO;
gabrieltetar 21:d137ec53c3a9 1050 } else if(TEST_A.Touched()) {
gabrieltetar 21:d137ec53c3a9 1051 while (TEST_A.Touched());
gabrieltetar 21:d137ec53c3a9 1052 BendRadius(150,1800,1,0);
gabrieltetar 21:d137ec53c3a9 1053 TEST_A.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 1054 } else if(TEST_B.Touched()) {
gabrieltetar 21:d137ec53c3a9 1055 while (TEST_B.Touched());
gabrieltetar 21:d137ec53c3a9 1056 BendRadius(150,1800,0,0);
gabrieltetar 21:d137ec53c3a9 1057 TEST_B.Draw(BLEU, BLANC);
gabrieltetar 21:d137ec53c3a9 1058 }
gabrieltetar 21:d137ec53c3a9 1059 }
gabrieltetar 21:d137ec53c3a9 1060 break; ///////////////////////////////////////////FIN DES DEMOS/////////////////////////////////////////////////
gabrieltetar 21:d137ec53c3a9 1061
gabrieltetar 21:d137ec53c3a9 1062
gabrieltetar 21:d137ec53c3a9 1063 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 1064 lcd.Clear(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1065 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1066 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 1067
gabrieltetar 21:d137ec53c3a9 1068 lcd.DisplayStringAt(70, LINE(0), (uint8_t *)"Choisir le cote", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1069 COTE_JAUNE.Draw(JAUNE, 0);
gabrieltetar 21:d137ec53c3a9 1070 COTE_VIOLET.Draw(VIOLET, 0);
gabrieltetar 21:d137ec53c3a9 1071 RETOUR.Draw(LCD_COLOR_RED, 0);
gabrieltetar 21:d137ec53c3a9 1072
gabrieltetar 21:d137ec53c3a9 1073
gabrieltetar 21:d137ec53c3a9 1074 while (strat_etat_s == SELECT_SIDE) {
gabrieltetar 21:d137ec53c3a9 1075 canProcessRx();
gabrieltetar 21:d137ec53c3a9 1076 if(COTE_JAUNE.Touched()) {
maximilienlv 28:7f2990747e09 1077 Cote = 0x1;
gabrieltetar 21:d137ec53c3a9 1078 InversStrat = Cote;
gabrieltetar 21:d137ec53c3a9 1079 strat_etat_s = TACTIQUE;
gabrieltetar 21:d137ec53c3a9 1080 CANMessage trame_Tx = CANMessage();
gabrieltetar 21:d137ec53c3a9 1081 trame_Tx.len = 1;
gabrieltetar 21:d137ec53c3a9 1082 trame_Tx.format = CANStandard;
gabrieltetar 21:d137ec53c3a9 1083 trame_Tx.type = CANData;
gabrieltetar 21:d137ec53c3a9 1084 trame_Tx.id=CHOICE_COLOR;
gabrieltetar 21:d137ec53c3a9 1085 trame_Tx.data[0]=Cote;
gabrieltetar 21:d137ec53c3a9 1086 can2.write(trame_Tx);
gabrieltetar 21:d137ec53c3a9 1087 while(COTE_JAUNE.Touched());
gabrieltetar 21:d137ec53c3a9 1088
gabrieltetar 21:d137ec53c3a9 1089 }
gabrieltetar 21:d137ec53c3a9 1090
gabrieltetar 21:d137ec53c3a9 1091 if(COTE_VIOLET.Touched()) {
maximilienlv 28:7f2990747e09 1092 Cote = 0x0;
gabrieltetar 21:d137ec53c3a9 1093 InversStrat= Cote;
gabrieltetar 21:d137ec53c3a9 1094 strat_etat_s = TACTIQUE;
gabrieltetar 21:d137ec53c3a9 1095 CANMessage trame_Tx = CANMessage();
gabrieltetar 21:d137ec53c3a9 1096 trame_Tx.len = 1;
gabrieltetar 21:d137ec53c3a9 1097 trame_Tx.format = CANStandard;
gabrieltetar 21:d137ec53c3a9 1098 trame_Tx.type = CANData;
gabrieltetar 21:d137ec53c3a9 1099 trame_Tx.id=CHOICE_COLOR;
gabrieltetar 21:d137ec53c3a9 1100 trame_Tx.data[0]=Cote;
gabrieltetar 21:d137ec53c3a9 1101 can2.write(trame_Tx);
gabrieltetar 21:d137ec53c3a9 1102 while(COTE_VIOLET.Touched());
gabrieltetar 21:d137ec53c3a9 1103 }
gabrieltetar 21:d137ec53c3a9 1104
gabrieltetar 21:d137ec53c3a9 1105 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 1106 strat_etat_s = CHOIX;
gabrieltetar 21:d137ec53c3a9 1107 while(RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 1108 }
gabrieltetar 21:d137ec53c3a9 1109 }
gabrieltetar 21:d137ec53c3a9 1110
gabrieltetar 21:d137ec53c3a9 1111 break;
gabrieltetar 21:d137ec53c3a9 1112
gabrieltetar 21:d137ec53c3a9 1113 case TACTIQUE : //AFFICHE LA LISTE DES STRATS AFIN DE SELECTIONNER CELLE VOULUE
slowness 29:ff575aff301f 1114 if (Cote == 1) {
gabrieltetar 21:d137ec53c3a9 1115 lcd.Clear(JAUNE);
gabrieltetar 21:d137ec53c3a9 1116 lcd.SetBackColor(JAUNE);
slowness 29:ff575aff301f 1117 } else if (Cote == 0) {
gabrieltetar 21:d137ec53c3a9 1118 lcd.Clear(VIOLET);
gabrieltetar 21:d137ec53c3a9 1119 lcd.SetBackColor(VIOLET);
gabrieltetar 21:d137ec53c3a9 1120 } else {
gabrieltetar 21:d137ec53c3a9 1121 lcd.Clear(BLEU);
gabrieltetar 21:d137ec53c3a9 1122 lcd.SetBackColor(BLEU);
gabrieltetar 21:d137ec53c3a9 1123 }
gabrieltetar 21:d137ec53c3a9 1124
gabrieltetar 21:d137ec53c3a9 1125 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 1126
gabrieltetar 21:d137ec53c3a9 1127 lcd.DisplayStringAt(20, LINE(0), (uint8_t *)"Choisir une strategie", LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1128
gabrieltetar 21:d137ec53c3a9 1129 nbStrat = Bouton_Strat(); // retourne valeur de Strategie si bouton strat renvoi -1 on reviens en arriere
gabrieltetar 21:d137ec53c3a9 1130 if (nbStrat == -1) {
gabrieltetar 21:d137ec53c3a9 1131 strat_etat_s = SELECT_SIDE;
gabrieltetar 21:d137ec53c3a9 1132 } else {
gabrieltetar 21:d137ec53c3a9 1133 strat_etat_s = DETAILS;
gabrieltetar 21:d137ec53c3a9 1134 }
gabrieltetar 21:d137ec53c3a9 1135 wait(0.1);
gabrieltetar 21:d137ec53c3a9 1136 break;
gabrieltetar 21:d137ec53c3a9 1137
gabrieltetar 21:d137ec53c3a9 1138 case DETAILS : //SECONDE VALIDATION DE LA STRAT
gabrieltetar 21:d137ec53c3a9 1139 lcd.Clear(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1140 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1141 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 1142 CHECK.Draw(VERT);
gabrieltetar 21:d137ec53c3a9 1143 RETOUR.Draw(LCD_COLOR_RED);
gabrieltetar 21:d137ec53c3a9 1144
gabrieltetar 21:d137ec53c3a9 1145 SelectionStrat(nbStrat); //affiche la stratégie selectionnée
gabrieltetar 21:d137ec53c3a9 1146
gabrieltetar 21:d137ec53c3a9 1147 while (strat_etat_s == DETAILS) {
gabrieltetar 21:d137ec53c3a9 1148 canProcessRx();
gabrieltetar 21:d137ec53c3a9 1149 if (CHECK.Touched()) {
gabrieltetar 21:d137ec53c3a9 1150 if(gameEtat == ETAT_CONFIG) {
gabrieltetar 21:d137ec53c3a9 1151 gameEtat = ETAT_GAME_INIT;
gabrieltetar 21:d137ec53c3a9 1152 strat_etat_s=LECTURE;
gabrieltetar 21:d137ec53c3a9 1153
gabrieltetar 21:d137ec53c3a9 1154 }
gabrieltetar 21:d137ec53c3a9 1155 while(CHECK.Touched());
gabrieltetar 21:d137ec53c3a9 1156 }
gabrieltetar 21:d137ec53c3a9 1157
gabrieltetar 21:d137ec53c3a9 1158 if(RETOUR.Touched()) {
gabrieltetar 21:d137ec53c3a9 1159 strat_etat_s = TACTIQUE;
gabrieltetar 21:d137ec53c3a9 1160 while(RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 1161 }
gabrieltetar 21:d137ec53c3a9 1162 }
gabrieltetar 21:d137ec53c3a9 1163 break;
gabrieltetar 21:d137ec53c3a9 1164
gabrieltetar 21:d137ec53c3a9 1165
gabrieltetar 21:d137ec53c3a9 1166 case LECTURE :
gabrieltetar 21:d137ec53c3a9 1167 break;
gabrieltetar 21:d137ec53c3a9 1168 case AFF_WAIT_JACK : //FONCTIONS D'AFFICHAGE DE L'ATTENTE DU JACK
gabrieltetar 21:d137ec53c3a9 1169 lcd.Clear(BLANC);
gabrieltetar 21:d137ec53c3a9 1170 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1171 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 1172
gabrieltetar 21:d137ec53c3a9 1173 if (Cote == 0) {
gabrieltetar 21:d137ec53c3a9 1174 lcd.Clear(VERT);
gabrieltetar 21:d137ec53c3a9 1175 lcd.SetBackColor(VERT);
gabrieltetar 21:d137ec53c3a9 1176 } else if (Cote == 1) {
gabrieltetar 21:d137ec53c3a9 1177 lcd.Clear(ORANGE);
gabrieltetar 21:d137ec53c3a9 1178 lcd.SetBackColor(ORANGE);
gabrieltetar 21:d137ec53c3a9 1179 } else {
gabrieltetar 21:d137ec53c3a9 1180 lcd.Clear(VERT);
gabrieltetar 21:d137ec53c3a9 1181 lcd.SetBackColor(VERT);
gabrieltetar 21:d137ec53c3a9 1182 }
gabrieltetar 21:d137ec53c3a9 1183 canProcessRx();
gabrieltetar 21:d137ec53c3a9 1184 lcd.DisplayStringAt(0, LINE(0), (uint8_t *)"En attente du Jack", CENTER_MODE);
gabrieltetar 21:d137ec53c3a9 1185 strat_etat_s=WAIT_JACK;
gabrieltetar 21:d137ec53c3a9 1186 break;
gabrieltetar 21:d137ec53c3a9 1187
gabrieltetar 21:d137ec53c3a9 1188 case WAIT_JACK: //VERITABLE ATTENTE DU JACK
gabrieltetar 21:d137ec53c3a9 1189 break;
gabrieltetar 21:d137ec53c3a9 1190
gabrieltetar 21:d137ec53c3a9 1191 case FIN : //AFFICHAGE DE FIN AVEC LE SCORE FINAL
gabrieltetar 21:d137ec53c3a9 1192 lcd.Clear (LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1193 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1194
gabrieltetar 21:d137ec53c3a9 1195
gabrieltetar 21:d137ec53c3a9 1196 while(1); // force le redemarage du robot
gabrieltetar 21:d137ec53c3a9 1197 //break;
gabrieltetar 21:d137ec53c3a9 1198
gabrieltetar 21:d137ec53c3a9 1199 }
gabrieltetar 21:d137ec53c3a9 1200 }
gabrieltetar 21:d137ec53c3a9 1201 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 1202 /* FUNCTION NAME: Bouton_Strat */
gabrieltetar 21:d137ec53c3a9 1203 /* DESCRIPTION : Sélection de la strat sur le lcd puis envoie sur CAN (à modifier!) */
gabrieltetar 21:d137ec53c3a9 1204 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 1205 signed char Bouton_Strat (void)
gabrieltetar 21:d137ec53c3a9 1206 {
gabrieltetar 21:d137ec53c3a9 1207 char Ack_strat = 0;
gabrieltetar 21:d137ec53c3a9 1208 signed char Strat = 0;
gabrieltetar 21:d137ec53c3a9 1209 Button STRAT_1 (0, 30, 190, 110, strat_sd[0]);
gabrieltetar 21:d137ec53c3a9 1210 Button STRAT_2 (210, 30, 190, 110, strat_sd[1]);
gabrieltetar 21:d137ec53c3a9 1211 Button STRAT_3 (0, 150, 190, 110, strat_sd[2]);
gabrieltetar 21:d137ec53c3a9 1212 Button STRAT_4 (210, 150, 190, 110, strat_sd[3]);
gabrieltetar 21:d137ec53c3a9 1213 Button STRAT_5 (0, 270, 190, 110,strat_sd[4]);
gabrieltetar 21:d137ec53c3a9 1214 Button STRAT_6 (210, 270, 190, 110, strat_sd[5]);
gabrieltetar 21:d137ec53c3a9 1215 Button STRAT_7 (0, 390, 190, 110, strat_sd[6]);
gabrieltetar 21:d137ec53c3a9 1216 Button STRAT_8 (210, 390, 190, 110, strat_sd[7]);
gabrieltetar 21:d137ec53c3a9 1217 Button STRAT_9 (0, 510, 190, 110, strat_sd[8]);
gabrieltetar 21:d137ec53c3a9 1218 Button STRAT_10 (210, 510, 190, 110, strat_sd[9]);
gabrieltetar 21:d137ec53c3a9 1219 Button RETOUR (0, 680, 400, 110, "--Precedent--");
gabrieltetar 21:d137ec53c3a9 1220 //Definition des boutons
gabrieltetar 21:d137ec53c3a9 1221
gabrieltetar 21:d137ec53c3a9 1222 Ack_strat = 0;
gabrieltetar 21:d137ec53c3a9 1223 Strat = 0;
gabrieltetar 21:d137ec53c3a9 1224 STRAT_1.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1225 STRAT_2.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1226 STRAT_3.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1227 STRAT_4.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1228 STRAT_5.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1229 STRAT_6.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1230 STRAT_7.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1231 STRAT_8.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1232 STRAT_9.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1233 STRAT_10.Draw(0xFFF0F0F0, 0);
gabrieltetar 21:d137ec53c3a9 1234 RETOUR.Draw(0xFFFF0000, 0);
gabrieltetar 21:d137ec53c3a9 1235
gabrieltetar 21:d137ec53c3a9 1236 while(Ack_strat == 0) {
gabrieltetar 21:d137ec53c3a9 1237 canProcessRx();
gabrieltetar 21:d137ec53c3a9 1238 CANMessage msgTx=CANMessage();
gabrieltetar 21:d137ec53c3a9 1239 //msgTx.id=ECRAN_CHOICE_STRAT;
gabrieltetar 21:d137ec53c3a9 1240 if (RETOUR.Touched())
gabrieltetar 21:d137ec53c3a9 1241 return -1;
gabrieltetar 21:d137ec53c3a9 1242 while(RETOUR.Touched());
gabrieltetar 21:d137ec53c3a9 1243 //////////////////////////////STRATEGIE N°1
gabrieltetar 21:d137ec53c3a9 1244 if (STRAT_1.Touched()) {
gabrieltetar 21:d137ec53c3a9 1245 Strat = 0;
gabrieltetar 21:d137ec53c3a9 1246 //msgTx.data[0] = 0x1;
gabrieltetar 21:d137ec53c3a9 1247 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1248 while(STRAT_1.Touched());
gabrieltetar 21:d137ec53c3a9 1249 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1250 }
gabrieltetar 21:d137ec53c3a9 1251 /////////////////////////////STRATEGIE N°2
gabrieltetar 21:d137ec53c3a9 1252 if (STRAT_2.Touched()) {
gabrieltetar 21:d137ec53c3a9 1253 Strat = 1;
gabrieltetar 21:d137ec53c3a9 1254 //msgTx.data[0] = 0x2;
gabrieltetar 21:d137ec53c3a9 1255 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1256 while(STRAT_2.Touched());
gabrieltetar 21:d137ec53c3a9 1257 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1258 }
gabrieltetar 21:d137ec53c3a9 1259 //////////////////////////////STRATEGIE N°3
gabrieltetar 21:d137ec53c3a9 1260 if (STRAT_3.Touched()) {
gabrieltetar 21:d137ec53c3a9 1261 Strat = 2;
gabrieltetar 21:d137ec53c3a9 1262 //msgTx.data[0] = 0x3;
gabrieltetar 21:d137ec53c3a9 1263 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1264 while(STRAT_3.Touched());
gabrieltetar 21:d137ec53c3a9 1265 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1266 }
gabrieltetar 21:d137ec53c3a9 1267 /////////////////////////////STRATEGIE N°4
gabrieltetar 21:d137ec53c3a9 1268 if (STRAT_4.Touched()) {
gabrieltetar 21:d137ec53c3a9 1269 Strat = 3;
gabrieltetar 21:d137ec53c3a9 1270 //msgTx.data[0] = 0x4;
gabrieltetar 21:d137ec53c3a9 1271 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1272 while(STRAT_4.Touched());
gabrieltetar 21:d137ec53c3a9 1273 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1274 }
gabrieltetar 21:d137ec53c3a9 1275 ///////////////////////////////STRATEGIE N°5
gabrieltetar 21:d137ec53c3a9 1276 if (STRAT_5.Touched()) {
gabrieltetar 21:d137ec53c3a9 1277 Strat = 4;
gabrieltetar 21:d137ec53c3a9 1278 //msgTx.data[0] = 0x5;
gabrieltetar 21:d137ec53c3a9 1279 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1280 while(STRAT_5.Touched());
gabrieltetar 21:d137ec53c3a9 1281 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1282 }
gabrieltetar 21:d137ec53c3a9 1283 ////////////////////////////////STRATEGIE N°6
gabrieltetar 21:d137ec53c3a9 1284 if (STRAT_6.Touched()) {
gabrieltetar 21:d137ec53c3a9 1285 Strat = 5;
gabrieltetar 21:d137ec53c3a9 1286 //msgTx.data[0] = 0x6;
gabrieltetar 21:d137ec53c3a9 1287 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1288 while(STRAT_6.Touched());
gabrieltetar 21:d137ec53c3a9 1289 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1290 }
gabrieltetar 21:d137ec53c3a9 1291 /////////////////////////////////STRATEGIE N°7
gabrieltetar 21:d137ec53c3a9 1292 if (STRAT_7.Touched()) {
gabrieltetar 21:d137ec53c3a9 1293 Strat = 6;
gabrieltetar 21:d137ec53c3a9 1294 //msgTx.data[0] = 0x7;
gabrieltetar 21:d137ec53c3a9 1295 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1296 while(STRAT_7.Touched());
gabrieltetar 21:d137ec53c3a9 1297 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1298 }
gabrieltetar 21:d137ec53c3a9 1299 /////////////////////////////////STRATEGIE N°8
gabrieltetar 21:d137ec53c3a9 1300 if (STRAT_8.Touched()) {
gabrieltetar 21:d137ec53c3a9 1301 Strat = 7;
gabrieltetar 21:d137ec53c3a9 1302 //msgTx.data[0] = 0x8;
gabrieltetar 21:d137ec53c3a9 1303 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1304 while(STRAT_8.Touched());
gabrieltetar 21:d137ec53c3a9 1305 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1306 }
gabrieltetar 21:d137ec53c3a9 1307 /////////////////////////////////STRATEGIE N°9
gabrieltetar 21:d137ec53c3a9 1308 if (STRAT_9.Touched()) {
gabrieltetar 21:d137ec53c3a9 1309 Strat = 8;
gabrieltetar 21:d137ec53c3a9 1310 //msgTx.data[0] = 0x9;
gabrieltetar 21:d137ec53c3a9 1311 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1312 while(STRAT_9.Touched());
gabrieltetar 21:d137ec53c3a9 1313 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1314 }
gabrieltetar 21:d137ec53c3a9 1315 ///////////////////////////////////STRATEGIE N°10
gabrieltetar 21:d137ec53c3a9 1316 if (STRAT_10.Touched()) {
gabrieltetar 21:d137ec53c3a9 1317 Strat = 9;
gabrieltetar 21:d137ec53c3a9 1318 //msgTx.data[0] = 0xA;
gabrieltetar 21:d137ec53c3a9 1319 //can2.write(msgTx);
gabrieltetar 21:d137ec53c3a9 1320 while(STRAT_10.Touched());
gabrieltetar 21:d137ec53c3a9 1321 Ack_strat =1;
gabrieltetar 21:d137ec53c3a9 1322 }
gabrieltetar 21:d137ec53c3a9 1323
gabrieltetar 21:d137ec53c3a9 1324 }
gabrieltetar 21:d137ec53c3a9 1325 return Strat;
gabrieltetar 21:d137ec53c3a9 1326
gabrieltetar 21:d137ec53c3a9 1327 }
gabrieltetar 21:d137ec53c3a9 1328 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 1329 /* FUNCTION NAME: SelectionStrat */
gabrieltetar 21:d137ec53c3a9 1330 /* DESCRIPTION : Affiche la Stratégie sélectionnée sur l'ihm */
gabrieltetar 21:d137ec53c3a9 1331 /****************************************************************************************/
gabrieltetar 21:d137ec53c3a9 1332
gabrieltetar 21:d137ec53c3a9 1333
gabrieltetar 21:d137ec53c3a9 1334 void SelectionStrat (unsigned char Strategie)
gabrieltetar 21:d137ec53c3a9 1335 {
gabrieltetar 21:d137ec53c3a9 1336 lcd.SetBackColor(LCD_COLOR_WHITE);
gabrieltetar 21:d137ec53c3a9 1337 lcd.SetTextColor(LCD_COLOR_BLACK);
gabrieltetar 21:d137ec53c3a9 1338
gabrieltetar 21:d137ec53c3a9 1339 switch (Strategie+1) {
gabrieltetar 21:d137ec53c3a9 1340 case 0x1 :
gabrieltetar 21:d137ec53c3a9 1341 //description de Strategie n°1
gabrieltetar 21:d137ec53c3a9 1342 lcd.DisplayStringAt(150, 0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1343 break;
gabrieltetar 21:d137ec53c3a9 1344
gabrieltetar 21:d137ec53c3a9 1345 case 0x2 :
gabrieltetar 21:d137ec53c3a9 1346 //description de Strategie n°2
gabrieltetar 21:d137ec53c3a9 1347 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1348 break;
gabrieltetar 21:d137ec53c3a9 1349
gabrieltetar 21:d137ec53c3a9 1350 case 0x3 :
gabrieltetar 21:d137ec53c3a9 1351 //description de Strategie n°3
gabrieltetar 21:d137ec53c3a9 1352 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1353 break;
gabrieltetar 21:d137ec53c3a9 1354
gabrieltetar 21:d137ec53c3a9 1355 case 0x4 :
gabrieltetar 21:d137ec53c3a9 1356 //description de Strategie n°4
gabrieltetar 21:d137ec53c3a9 1357 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1358 break;
gabrieltetar 21:d137ec53c3a9 1359
gabrieltetar 21:d137ec53c3a9 1360 case 0x5 :
gabrieltetar 21:d137ec53c3a9 1361 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 1362 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1363 break;
gabrieltetar 21:d137ec53c3a9 1364
gabrieltetar 21:d137ec53c3a9 1365 case 0x6 :
gabrieltetar 21:d137ec53c3a9 1366 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 1367 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1368 break;
gabrieltetar 21:d137ec53c3a9 1369
gabrieltetar 21:d137ec53c3a9 1370 case 0x7 :
gabrieltetar 21:d137ec53c3a9 1371 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 1372 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1373 break;
gabrieltetar 21:d137ec53c3a9 1374
gabrieltetar 21:d137ec53c3a9 1375 case 0x8 :
gabrieltetar 21:d137ec53c3a9 1376 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 1377 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1378 break;
gabrieltetar 21:d137ec53c3a9 1379
gabrieltetar 21:d137ec53c3a9 1380 case 0x9 :
gabrieltetar 21:d137ec53c3a9 1381 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 1382 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1383 break;
gabrieltetar 21:d137ec53c3a9 1384
gabrieltetar 21:d137ec53c3a9 1385 case 0xA :
gabrieltetar 21:d137ec53c3a9 1386 //description de Strategie n°5
gabrieltetar 21:d137ec53c3a9 1387 lcd.DisplayStringAt(150,0, (uint8_t *)strat_sd[Strategie], LEFT_MODE);
gabrieltetar 21:d137ec53c3a9 1388 break;
gabrieltetar 21:d137ec53c3a9 1389 }
gabrieltetar 27:ff70537a7619 1390 }
gabrieltetar 27:ff70537a7619 1391
gabrieltetar 27:ff70537a7619 1392 void DrawC (int l,int h,int x, int y, unsigned char fill){
gabrieltetar 27:ff70537a7619 1393 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 1394 for(int a=0;a<8;a++){
gabrieltetar 27:ff70537a7619 1395 c[a].X+=x;
gabrieltetar 27:ff70537a7619 1396 c[a].Y+=y;
gabrieltetar 27:ff70537a7619 1397 }
gabrieltetar 27:ff70537a7619 1398 lcd.DrawPolygon(c, 8);
gabrieltetar 27:ff70537a7619 1399
gabrieltetar 27:ff70537a7619 1400 }
gabrieltetar 27:ff70537a7619 1401 void DrawR (int l,int h,int x, int y, unsigned char fill){
gabrieltetar 27:ff70537a7619 1402 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 1403 for(int a=0;a<10;a++){
gabrieltetar 27:ff70537a7619 1404 r[a].X+=x;
gabrieltetar 27:ff70537a7619 1405 r[a].Y+=y;
gabrieltetar 27:ff70537a7619 1406 }
gabrieltetar 27:ff70537a7619 1407 lcd.DrawPolygon(r, 10);
gabrieltetar 27:ff70537a7619 1408 }
gabrieltetar 27:ff70537a7619 1409 void DrawA (int l,int h,int x, int y, unsigned char fill){
gabrieltetar 27:ff70537a7619 1410 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 1411 for(int z=0;z<8;z++){
gabrieltetar 27:ff70537a7619 1412 a[z].X+=x;
gabrieltetar 27:ff70537a7619 1413 a[z].Y+=y;
gabrieltetar 27:ff70537a7619 1414 }
gabrieltetar 27:ff70537a7619 1415 lcd.DrawPolygon(a, 8);
gabrieltetar 27:ff70537a7619 1416 }
gabrieltetar 27:ff70537a7619 1417 void DrawCheck (int l,int h,int x, int y, int cochage){
gabrieltetar 27:ff70537a7619 1418 if(x<3)x=3;
gabrieltetar 27:ff70537a7619 1419 if(cochage == 1){
gabrieltetar 27:ff70537a7619 1420 lcd.SetTextColor(VERT_F);
gabrieltetar 27:ff70537a7619 1421 lcd.DrawLine(x,y-(h/2),x+l/2,y+h/2);
gabrieltetar 27:ff70537a7619 1422 lcd.DrawLine(x-1,y-(h/2),x+l/2,y+h/2+1);
gabrieltetar 27:ff70537a7619 1423 lcd.DrawLine(x-2,y-(h/2),x+l/2,y+h/2+2);
gabrieltetar 27:ff70537a7619 1424 lcd.DrawLine(x+l/2,y+h/2,x+(4*(l/3)),y);
gabrieltetar 27:ff70537a7619 1425 lcd.DrawLine(x+l/2,y+h/2+1,x+(4*(l/3))+1,y);
gabrieltetar 27:ff70537a7619 1426 lcd.DrawLine(x+l/2,y+h/2+2,x+(4*(l/3))+2,y);
gabrieltetar 27:ff70537a7619 1427 lcd.SetTextColor(NOIR);
gabrieltetar 27:ff70537a7619 1428 } else {
gabrieltetar 27:ff70537a7619 1429 Point a[4]={{0,0},{l,0},{l,h},{0,h}};
gabrieltetar 27:ff70537a7619 1430 for(int z=0;z<8;z++){
gabrieltetar 27:ff70537a7619 1431 a[z].X+=x;
gabrieltetar 27:ff70537a7619 1432 a[z].Y+=y;
gabrieltetar 27:ff70537a7619 1433 }
gabrieltetar 27:ff70537a7619 1434 lcd.DrawPolygon(a, 4);
gabrieltetar 27:ff70537a7619 1435 }
gabrieltetar 21:d137ec53c3a9 1436 }