CARPENTIER ANTOINE / Mbed 2 deprecated panneau

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 ////////////// INCLUSION DES LIBRAIRIES (L1-L18)//////////////
00002 #include "mbed.h"
00003 #include "LEDMatrix.h"
00004 #include "smallFont.h"
00005 #include "stm32746g_discovery_ts.h"
00006 #include "stm32746g_discovery_lcd.h"
00007 #include "fleche.h"
00008 #include "dessin.h"
00009 #include "drapeau.h"
00010 #include "croixbmp.h"
00011 #include "gommebmp.h"
00012 #include "allemagnebmp.h"
00013 #include "belgiquebmp.h"
00014 #include "beninbmp.h"
00015 #include "francebmp.h"
00016 #include "lgbpbmp.h"
00017 #include "italiebmp.h"
00018 /////////////////FIN INCLUSION DES LIBRAIRIES/////////////////
00019 
00020 
00021 
00022 //////DEFINITION LARGEUR ET LONGUEURE DE LECRAN LED (L22-L25)//////
00023 #define WIDTH   64
00024 #define HEIGHT  32
00025 //////// FIN DEFINITION LARGEUR ET LONGUEURE DE LECRAN LED ////////
00026 
00027 
00028 
00029 //stb c'est le latch
00030 // LEDMatrix    (a, b,  c, d,  oe_1, r1, r2, b1, b2, g1, g2, stb_1, clk_1);
00031 LEDMatrix matrix(D1,D10,D0,D11,D7,   D5, D3, D4, D2, D8, D9, D12,   D13);
00032 Ticker scanner;
00033 
00034 
00035 // Display Buffer
00036 uint8_t displaybuf[2][WIDTH *HEIGHT] = {
00037     0x00
00038 };
00039 
00040 
00041 
00042 /////////DEFINITION DES PROTOTYPES (L42-L46)/////////
00043 void page_accueil(void);
00044 void page_dessin(void);
00045 void page_drapeau(void);
00046 /////////FIN DE DEFINITION DES PROTOTYPES////////////
00047 
00048 
00049 /////////DEFINITION DES VARIABLES GLOBALES (L49-L53)/////////
00050 int xb=0, yb=0; // La valeur de x et y correspondante a l'ecran LCD
00051 uint8_t text[30]; // SPRINTF
00052 int p=0;// Pour le multicolor
00053 /////////FIN DE DEFINITION DES VARIABLES GLOBALES ////////////
00054 
00055 
00056 
00057 ////////////////DEFINITION DES FONCTIONS DE DESSIN D'IMAGE (L57-L246)/////////////////////
00058 //fleche
00059 void drawImage_fleche(int offsetX, int offsetY)
00060 {
00061     int x = 0;
00062     int y = 0;
00063     uint32_t* dataPtr = (uint32_t*)fleche.data;
00064     while(y < fleche.height) {
00065         while(x < fleche.width) {
00066             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00067             dataPtr++;
00068             x++;
00069         }
00070         x = 0;
00071         y++;
00072     }
00073 }
00074 
00075 //belgique
00076 void drawImage_belgique(int offsetX, int offsetY)
00077 {
00078     int x = 0;
00079     int y = 0;
00080     uint32_t* dataPtr = (uint32_t*)belgiquebmp.data;
00081     while(y < belgiquebmp.height) {
00082         while(x < belgiquebmp.width) {
00083             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00084             dataPtr++;
00085             x++;
00086         }
00087         x = 0;
00088         y++;
00089     }
00090 }
00091 
00092 //allemagne
00093 void drawImage_allemagne(int offsetX, int offsetY)
00094 {
00095     int x = 0;
00096     int y = 0;
00097     uint32_t* dataPtr = (uint32_t*)allemagnebmp.data;
00098     while(y < allemagnebmp.height) {
00099         while(x < allemagnebmp.width) {
00100             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00101             dataPtr++;
00102             x++;
00103         }
00104         x = 0;
00105         y++;
00106     }
00107 }
00108 
00109 //benin
00110 void drawImage_benin(int offsetX, int offsetY)
00111 {
00112     int x = 0;
00113     int y = 0;
00114     uint32_t* dataPtr = (uint32_t*)beninbmp.data;
00115     while(y < beninbmp.height) {
00116         while(x < beninbmp.width) {
00117             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00118             dataPtr++;
00119             x++;
00120         }
00121         x = 0;
00122         y++;
00123     }
00124 }
00125 
00126 //france
00127 void drawImage_france(int offsetX, int offsetY)
00128 {
00129     int x = 0;
00130     int y = 0;
00131     uint32_t* dataPtr = (uint32_t*)francebmp.data;
00132     while(y < francebmp.height) {
00133         while(x < francebmp.width) {
00134             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00135             dataPtr++;
00136             x++;
00137         }
00138         x = 0;
00139         y++;
00140     }
00141 }
00142 
00143 //italie
00144 void drawImage_italie(int offsetX, int offsetY)
00145 {
00146     int x = 0;
00147     int y = 0;
00148     uint32_t* dataPtr = (uint32_t*)italiebmp.data;
00149     while(y < italiebmp.height) {
00150         while(x < italiebmp.width) {
00151             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00152             dataPtr++;
00153             x++;
00154         }
00155         x = 0;
00156         y++;
00157     }
00158 }
00159 
00160 //lgbt
00161 void drawImage_lgbt(int offsetX, int offsetY)
00162 {
00163     int x = 0;
00164     int y = 0;
00165     uint32_t* dataPtr = (uint32_t*)lgbpbmp.data;
00166     while(y < lgbpbmp.height) {
00167         while(x < lgbpbmp.width) {
00168             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00169             dataPtr++;
00170             x++;
00171         }
00172         x = 0;
00173         y++;
00174     }
00175 }
00176 
00177 //drapeau
00178 void drawImage_drapeau(int offsetX, int offsetY)
00179 {
00180     int x = 0;
00181     int y = 0;
00182     uint32_t* dataPtr = (uint32_t*)drapeau.data;
00183     while(y < drapeau.height) {
00184         while(x < drapeau.width) {
00185             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00186             dataPtr++;
00187             x++;
00188         }
00189         x = 0;
00190         y++;
00191     }
00192 }
00193 
00194 
00195 //gomme
00196 void drawImage_gomme(int offsetX, int offsetY)
00197 {
00198     int x = 0;
00199     int y = 0;
00200     uint32_t* dataPtr = (uint32_t*)gommebmp.data;
00201     while(y < gommebmp.height) {
00202         while(x < gommebmp.width) {
00203             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00204             dataPtr++;
00205             x++;
00206         }
00207         x = 0;
00208         y++;
00209     }
00210 }
00211 
00212 //croix
00213 void drawImage_croix(int offsetX, int offsetY)
00214 {
00215     int x = 0;
00216     int y = 0;
00217     uint32_t* dataPtr = (uint32_t*)croixbmp.data;
00218     while(y < croixbmp.height) {
00219         while(x < croixbmp.width) {
00220             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00221             dataPtr++;
00222             x++;
00223         }
00224         x = 0;
00225         y++;
00226     }
00227 }
00228 
00229 
00230 //dessin
00231 void drawImage_dessin(int offsetX, int offsetY)
00232 {
00233     int x = 0;
00234     int y = 0;
00235     uint32_t* dataPtr = (uint32_t*)dessin.data;
00236     while(y < dessin.height) {
00237         while(x < dessin.width) {
00238             BSP_LCD_DrawPixel(x + offsetX, y + offsetY, *dataPtr);
00239             dataPtr++;
00240             x++;
00241         }
00242         x = 0;
00243         y++;
00244     }
00245 }
00246 ////////////////FIN DEFINITION DES FONCTIONS DE DESSIN D'IMAGE (L57-L246)/////////////////////
00247 
00248 
00249 
00250 
00251 
00252 /// FONCTION DE SCAN DE L'ECRAN LED//////
00253 void scan()
00254 {
00255     matrix.scan();
00256 }
00257 ///FIN FONCTION DE SCAN DE L'ECRAN LED//////
00258 
00259 
00260 
00261 
00262 ///////////////////////// DEBUT DU MAIN (L262-L652)////////////////////////////////////////
00263 int main()
00264 {
00265     TS_StateTypeDef TS_State; // Definition de l'objet qui servira pour la detection de clic sur la STM32
00266     
00267     
00268     //Definition des variables locales au main
00269     uint16_t x, y;
00270     uint8_t status;
00271     uint8_t idx;
00272     int i,  c=1;
00273     int page = 0;   // La variable page défini la page sur laquelle on se trouve; page = 0 = page d'accueil; page = 1 = page dessin; page = 2 = page drapeau
00274     int couleur=7;//1 rouge; 2 vert; 3 jaune; 4 bleu; 5 violet; 6 cyan; 7 blanc
00275     
00276     
00277     ////////////////INITIALISATION DE LECRAN DE LA STM32//////////////
00278     BSP_LCD_Init();
00279     BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FB_START_ADDRESS);
00280     BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER);
00281     //////////////////////////////////////////////////////////////////
00282 
00283 
00284     status = BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize());               // Recupération d'un status
00285     if (status != TS_OK) {                                                      // SI LE STATUS N'EST PAS OK L'INIT FAIL
00286         BSP_LCD_Clear(LCD_COLOR_WHITE);
00287         BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
00288         BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
00289         BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"TOUCHSCREEN INIT FAIL", CENTER_MODE);   
00290     } 
00291     else {                                                                      // SINON "INITIALISATION S'AFFICHE
00292         BSP_LCD_Clear(LCD_COLOR_WHITE);
00293         BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
00294         BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
00295         BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"INITIALISATION", CENTER_MODE);        
00296     }
00297 
00298     HAL_Delay(500);                         // Delais en ms
00299     BSP_LCD_SetFont(&Font12);               // Police d'écriture
00300     BSP_LCD_SetBackColor(LCD_COLOR_WHITE);  // Fond blanc
00301     BSP_LCD_SetTextColor(LCD_COLOR_BLUE);   // Coleur du texte bleu
00302     
00303     initFonts(); 
00304 
00305     matrix.begin((uint8_t *)displaybuf, WIDTH, HEIGHT);     // Sauv en mémoire la taille de la matrice LED
00306     
00307     scanner.attach(scan, 0.0003);   //Gère l'affiche sur la matrice LED
00308                                     //Un scan trop lent (>0.0009) provoque un effet de scintillement
00309                                     //Un scan trop rapide (<0.0001) provoque un effet d'allumage des LEDs qui sont sur la même ligne
00310     
00311     
00312     matrix.clear();                 //Fonction de nettoyage de la matrice, toutes les LEDs s'éteignent  
00313     
00314     
00315     // Drapeau de la France (sur la matrice)      
00316     matrix.drawRect(0,0,21,64,4);  
00317     matrix.drawRect(21,0,43,64,7);// Allumage d'une zone rectangulaire sur l'écran LED
00318     matrix.drawRect(43,0,64,64,1);   
00319     
00320     matrix.swap();
00321     while (!matrix.synchro());
00322     wait(1);
00323     matrix.clear();
00324         
00325 
00326     for (i=200; i>-400; i-=4) 
00327         {
00328             matrix.clear();
00329             matrix.drawCharString(i,0,"MATRICE LED LP SESAM",c,fonts[0]);   //Affichage de texte sur la matrice
00330             matrix.drawCharString(i,15,"CARPENTIER ANTOINE",c,fonts[0]);
00331             matrix.swap();
00332             wait(0.05);
00333             while (!matrix.synchro());
00334         }
00335         matrix.clear();
00336         
00337         BSP_LCD_Clear(LCD_COLOR_WHITE); // Effacage de l'ecran LCD
00338     
00339     
00340     ///////////// BOUCLE INFINI //////////////
00341     while (1) {  
00342         
00343         
00344         BSP_TS_GetState(&TS_State);     // Recuperation de l'état du tactile 
00345         
00346         if (TS_State.touchDetected)     // Si l'écran est touché
00347         {           
00348             x = TS_State.touchX[idx];   //Recuperation de la coordonné en x
00349             y = TS_State.touchY[idx];   //Recuperation de la coordonné en y
00350             xb = x/7.5;                 // xb fait correspondre la led aux pixels correspondant
00351             yb = y/7.5;                 // yb fait correspondre la led aux pixels correspondant
00352         }
00353     
00354     
00355         
00356         if (page == 0)
00357         {
00358              page_accueil();    // Par défault cette page est affiché
00359             }
00360                
00361         
00362         //VERS PAGE DESSIN
00363         if ((page == 0) && (x>= 10 && x<= 235) && (y>= 10 && y<= 235))  //Si nous sommes sur la page d'accueil et que nous cliquons dans la zone alors :
00364         {
00365             x=0;
00366             y=272;
00367             BSP_LCD_Clear(LCD_COLOR_WHITE); //On efface tout et on passe à la page suivante
00368             matrix.clear();
00369             matrix.swap();
00370             while (!matrix.synchro()); 
00371             page = 1;                       //Passage a la page dessin
00372             HAL_Delay(300);
00373         }
00374             
00375             
00376         // VERS DRAPEAU   
00377         if ((page==0)&&(x>=245 && x<=470)&&(y>= 10 && y<= 235))           //Si nous sommes sur la page d'accueil et que nous cliquons dans la zone alors :
00378         {
00379             x=0;
00380             y=0;
00381             BSP_LCD_Clear(LCD_COLOR_WHITE);     //On efface tout et on passe à la page suivante
00382             matrix.clear();
00383             matrix.swap();
00384             while (!matrix.synchro()); 
00385             page = 2;                           //Passage a la page drapeau
00386             HAL_Delay(100);
00387         }
00388         
00389         
00390         
00391         if(page == 1)               //SI NOUS SOMMES SUR LA PAGE DESSIN:
00392         {     
00393             page_dessin();          //Dessin des rectangles 
00394         
00395             matrix.swap();
00396             while (!matrix.synchro());   
00397         
00398             if (y<241)
00399             {
00400             
00401             
00402                 if(couleur != 0)            //SI LA GOMME N'EST PAS SELECTIONNé
00403                 {
00404                     BSP_LCD_DrawPixel(TS_State.touchX[0], TS_State.touchY[0], LCD_COLOR_ORANGE);       // Dessine sur l'ecran LCD
00405                     matrix.drawPoint(xb,yb,couleur);                                                   // Dessine sur la matrice LED aux coordonnées correspondantes à la où on touche sur la STM32
00406                                                                                                        // Taille du pointeur = 1x1
00407                 }
00408                 
00409                 else                        //SI LA GOMME EST SELECTIONNé
00410                 {
00411                     BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
00412                     BSP_LCD_FillRect(x-7.5,y-7.5,22.5,22.5);    //DESSINE DES CARRES BLANC SUR LECRAN LCD POUR EFFACER LA ZONE
00413                     
00414                     matrix.drawPoint(xb,yb,couleur);            // Couleur = 0 = ETEINT
00415                     matrix.drawPoint(xb+1,yb+1,couleur);
00416                     matrix.drawPoint(xb-1,yb-1,couleur);
00417                     matrix.drawPoint(xb+1,yb-1,couleur);
00418                     matrix.drawPoint(xb-1,yb+1,couleur);
00419                     matrix.drawPoint(xb-1,yb,couleur);
00420                     matrix.drawPoint(xb,yb-1,couleur);
00421                     matrix.drawPoint(xb+1,yb,couleur);
00422                     matrix.drawPoint(xb,yb+1,couleur);          // Taille du pointeur = 3x3 
00423                 }
00424             
00425                 matrix.swap();
00426                 while (!matrix.synchro());
00427             }
00428             
00429          
00430         ////BARRE DES COMMANDE, CHOIX DES COULEURS DES LEDS, GOMME ... (L430-L536)/////
00431         if (x<=43 && x>=2 && y<=270 && y>=242 )
00432         {
00433             p=0;
00434             couleur = 1;    //ROUGE
00435         }
00436         
00437         if (x<=86 && x>=45 && y<=270 && y>=242 )
00438         {
00439             p=0;
00440             couleur = 2;    //VERT
00441         }
00442             
00443         if (x<=129 && x>=88 && y<=270 && y>=242 )
00444         {
00445             p=0;
00446             couleur = 4;    //BLEU
00447         }
00448         
00449         if (x<=172 && x>=131 && y<=270 && y>=242 )
00450         {
00451             p=0;
00452             couleur = 5;    //VIOLET
00453         }
00454         
00455         if (x<=215 && x>=174 && y<=270 && y>=242 )
00456         {
00457             p=0;
00458             couleur = 6;    //CYAN
00459         }
00460         
00461         if (x<=258 && x>=217 && y<=270 && y>=242 )
00462         {
00463             p=0;
00464             couleur = 3;    //JAUNE
00465         }
00466             
00467         if (x<=301 && x>=260 && y<=270 && y>=242 )
00468         {
00469             p=0;
00470             couleur = 7;    //BLANC
00471         }
00472         
00473         
00474         //CLIC MULTICOLOR     
00475         if (x<=344 && x>=303 && y<=270 && y>=242 )
00476         {
00477             p=1;     
00478         }
00479         
00480         //MULTICOLOR  
00481         if (p==1)
00482         {
00483             // DEFINITON DE ZONE ET DE COULEUR EN FONCTION 
00484             
00485             if (x<68 && y<91)couleur=7;
00486             if (x>=68 && x<136 && y<91)couleur=6;
00487             if (x>=136 && x<204 && y<91)couleur=5;
00488             if (x>=204 && x<272 && y<91)couleur=3;
00489             if (x>=272 && x<340 && y<91)couleur=4;
00490             if (x>=340 && x<408 && y<91)couleur=2;
00491             if (x>=408 && x<480 && y<91)couleur=1;   
00492             
00493             if (x<68   && y<91)couleur=1;
00494             if (x>=68  && x<136 && y<181 && y>90)couleur=2;
00495             if (x>=136 && x<204 && y<181 && y>90)couleur=3;
00496             if (x>=204 && x<272 && y<181 && y>90)couleur=4;
00497             if (x>=272 && x<340 && y<181 && y>90)couleur=5;
00498             if (x>=340 && x<408 && y<181 && y>90)couleur=6;
00499             if (x>=408 && x<480 && y<181 && y>90)couleur=7;  
00500             
00501             if (x<68   && y<91)couleur=5;
00502             if (x>=68  && x<136 && y>180)couleur=7;
00503             if (x>=136 && x<204 && y>180)couleur=2;
00504             if (x>=204 && x<272 && y>180)couleur=4;
00505             if (x>=272 && x<340 && y>180)couleur=1;
00506             if (x>=340 && x<408 && y>180)couleur=3;
00507             if (x>=408 && x<480 && y>180)couleur=6;  
00508         }
00509     
00510         //GOMME
00511         if (x<=396 && x>=355 && y<=267 && y>=254 )
00512         {
00513             p=0;
00514             couleur = 0;
00515         }
00516             
00517         //EFFACE TOUT
00518         if (x<=438 && x>=410 && y<=267 && y>=254 )
00519         {
00520             x=0;
00521             y=0;
00522             BSP_LCD_Clear(LCD_COLOR_WHITE);
00523             matrix.clear();
00524         }
00525         
00526         //RETOUR PAGE ACCUEIL 
00527         if ((x>= 458 && x<= 480) && (y>= 240 && y<= 270))
00528         {
00529             BSP_LCD_Clear(LCD_COLOR_WHITE);
00530             matrix.clear();
00531             matrix.swap();
00532             while (!matrix.synchro()); 
00533             x = 0;
00534             y = 0;
00535             page = 0;
00536         }
00537               
00538     }//FIN IF PAGE == 1 
00539     
00540         
00541         
00542         if (page == 2)  //PAGE DRAPEAU
00543         {
00544             page_drapeau();         //Affichage de la page drapeau
00545                            
00546             //HAUT GAUCHE
00547             if ((x>= 8 && x<= 236) && (y>= 29 && y<= 103))
00548             {
00549                 x = 0;
00550                 y = 0;
00551                 //ALLEMAGNE
00552                 matrix.clear();
00553                 matrix.drawRect(0,10,64,21,3);
00554                 matrix.drawRect(0,21,64,32,1); 
00555                 matrix.swap();
00556                 while (!matrix.synchro());
00557             }
00558                    
00559             // HAUT DROITE  
00560             else if ((x>= 244 && x<= 472) && (y>= 29 && y<= 103))
00561             {
00562                  x = 0;
00563                  y = 0;
00564                 // BELGE
00565                 matrix.clear();        
00566                 matrix.drawRect(21,0,43,64,3);
00567                 matrix.drawRect(43,0,64,64,1);
00568                 matrix.swap();
00569                 while (!matrix.synchro());  
00570             }
00571                     
00572             // MILIEU GAUCHE 
00573             else if ((x>= 8 && x<= 236) && (y>= 110 && y<= 184))
00574             {
00575                 x = 0;
00576                 y = 0;
00577                 //BENIN
00578                 matrix.clear();        
00579                 matrix.drawRect(0,0,21,64,2);
00580                 matrix.drawRect(21,0,64,16,3);
00581                 matrix.drawRect(21,16,64,32,1);  
00582                 matrix.swap();
00583                 while (!matrix.synchro());
00584             }
00585     
00586             // MILIEU DROITE  
00587             else if ((x>= 244 && x<= 472) && (y>= 110 && y<= 184))
00588             {
00589                 x = 0;
00590                 y = 0;
00591                 //MULTICOLOR
00592                 matrix.clear();//1 rouge; 2 vert; 3 jaune; 4 bleu; 5 violet; 6 cyan; 7 blanc
00593                 matrix.drawRect(0,0,64,4,7);
00594                 matrix.drawRect(0,4,64,8,1);
00595                 matrix.drawRect(0,8,64,12,3);
00596                 matrix.drawRect(0,12,64,16,2);
00597                 matrix.drawRect(0,16,64,20,4);
00598                 matrix.drawRect(0,20,64,24,6);
00599                 matrix.drawRect(0,24,64,28,5);
00600                 matrix.drawRect(0,28,64,32,7);
00601                 matrix.swap();
00602                 while (!matrix.synchro());    
00603             }
00604                     
00605             // BAS GAUCHE    
00606             else if ((x>= 8 && x<= 236) && (y>= 192 && y<= 266))
00607             {
00608                 x = 0;
00609                 y = 0;
00610                 //FRANCE
00611                 matrix.clear();        
00612                 matrix.drawRect(0,0,21,64,4);
00613                 matrix.drawRect(21,0,43,64,7);
00614                 matrix.drawRect(43,0,64,64,1);    
00615                 matrix.swap();
00616                 while (!matrix.synchro());
00617             }
00618                 
00619                 
00620             // BAS DROITE
00621             else if ((x>= 244 && x<= 472) && (y>= 192 && y<= 266))
00622             {
00623                  x = 0;
00624                  y = 0;
00625                  //ITALIE
00626                  matrix.clear();        
00627                  matrix.drawRect(0,0,21,64,2);
00628                  matrix.drawRect(21,0,43,64,7);
00629                  matrix.drawRect(43,0,64,64,1);  
00630                  matrix.swap();
00631                  while (!matrix.synchro());
00632             }
00633                 
00634             if ((page==2)&&(x>= 458 && x<= 480) && (y>= 0 && y<= 22))
00635             {
00636                 BSP_LCD_Clear(LCD_COLOR_WHITE);
00637                 matrix.clear();
00638                 matrix.swap();
00639                 while (!matrix.synchro()); 
00640                 x = 0;
00641                 y = 0;
00642                 page = 0;
00643             }     
00644             
00645         } // FIN IF == 2
00646 
00647     
00648     }// FIN WHILE
00649     
00650 
00651 }// FIN MAIN
00652 ///////////////////////// FIN DU MAIN (L262-L652)////////////////////////////////////////
00653 
00654 
00655 
00656 
00657 
00658 
00659 //////////////////// FONCTIONS PAGES (L659-L737) ///////////////////////////////////////////////////////
00660 void page_accueil()
00661 {
00662     BSP_LCD_SetTextColor(LCD_COLOR_BLACK); //Couleur du texte
00663     BSP_LCD_DrawRect(10, 10, 225, 225);    //Bouton dessin 
00664     BSP_LCD_DrawRect(245, 10, 225, 225);   //Bouton drapeau
00665     
00666     sprintf((char*)text, "DESSIN");                                         //texte a ecrire
00667     BSP_LCD_DisplayStringAt(95, LINE(20), (uint8_t *)&text, LEFT_MODE);     //position du texte
00668     drawImage_dessin(15,15);                                                //fonction de dessin de l'image "dessin"
00669     
00670     sprintf((char*)text,"DRAPEAU");                                         //texte a ecrire
00671     BSP_LCD_DisplayStringAt(120, LINE(20), (uint8_t *)&text, CENTER_MODE);  //position du texte
00672     drawImage_drapeau(250, 15);                                             //fonction de dessin de l'image "drapeau"
00673     }   
00674     
00675     
00676 void page_dessin()
00677 {
00678         //AFFICHAGE DE LA BARRE DE COMMANDE 
00679         
00680         // ROUGE
00681         BSP_LCD_SetTextColor(LCD_COLOR_RED);
00682         BSP_LCD_FillRect(2,242,41, 28);
00683         //VERT
00684         BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
00685         BSP_LCD_FillRect(45,242,41, 28);
00686         //BLEU
00687         BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
00688         BSP_LCD_FillRect(88,242,41, 28);
00689         //VIOLET
00690         BSP_LCD_SetTextColor(LCD_COLOR_MAGENTA);
00691         BSP_LCD_FillRect(131,242,41, 28);
00692         //CYAN
00693         BSP_LCD_SetTextColor(LCD_COLOR_CYAN);
00694         BSP_LCD_FillRect(174,242,41, 28);
00695         //JAUNE
00696         BSP_LCD_SetTextColor(LCD_COLOR_YELLOW);
00697         BSP_LCD_FillRect(217,242,41, 28);
00698         //BLANC
00699         BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
00700         BSP_LCD_DrawRect(260, 242, 41, 28);
00701         //MULTICOLOR
00702         BSP_LCD_SetTextColor(LCD_COLOR_RED);
00703         BSP_LCD_FillRect(303,242,10, 28);
00704         BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
00705         BSP_LCD_FillRect(314,242,10, 28);
00706         BSP_LCD_SetTextColor(LCD_COLOR_YELLOW);
00707         BSP_LCD_FillRect(325,242,10, 28);
00708         BSP_LCD_SetTextColor(LCD_COLOR_CYAN);
00709         BSP_LCD_FillRect(336,242,10, 28);
00710          
00711         drawImage_gomme(355,245); //GOMME
00712         drawImage_croix(410,243); //EFFACER TOUT
00713         drawImage_fleche(445,245); // Retour
00714                 
00715         BSP_LCD_SetTextColor(LCD_COLOR_BLACK);  
00716         BSP_LCD_DrawHLine(0,240,480);        
00717     }
00718 
00719 void page_drapeau()
00720 {                                             
00721     BSP_LCD_DrawRect (8,  29, 228, 74);                 
00722     BSP_LCD_DrawRect (8,  110,228, 74);              
00723     BSP_LCD_DrawRect (8,  191,228, 73);    
00724     BSP_LCD_DrawRect (244,29, 228, 74); 
00725     BSP_LCD_DrawRect (244,110,228, 74);
00726     BSP_LCD_DrawRect (244,191,228, 73);
00727          
00728     drawImage_allemagne(10,31);            
00729     drawImage_belgique (246,31);
00730     drawImage_benin    (10,111);          
00731     drawImage_lgbt     (246,111);
00732     drawImage_france   (10,192);                      
00733     drawImage_italie   (246,192);                                        
00734     drawImage_fleche   (447,0);     // RETOUR
00735     
00736     }
00737 //////////////////// FIN DES FONCTIONS PAGES (L659-L737) ///////////////////////////////////////////////////////
00738 
00739 
00740 
00741 
00742 
00743         
00744        
00745        
00746 
00747 
00748 
00749 
00750 
00751 
00752 
00753 
00754 
00755