
X
Dependencies: mbed BSP_DISCO_F746NG
Diff: fonctions.cpp
- Revision:
- 4:8f6e0ef3fffe
- Parent:
- 3:92661d767dd1
--- a/fonctions.cpp Sun Nov 08 18:33:37 2020 +0000 +++ b/fonctions.cpp Wed Nov 11 15:27:24 2020 +0000 @@ -1,5 +1,21 @@ #include "fonctions.h" +void Affiche_Ingredients(int TAB_ingredients[]){ + int i=0; + BSP_LCD_SetTextColor(LCD_COLOR_BLACK); + for(i=0; i<3; i++){ + char Text[1]; + sprintf((char*)&Text, "%d", TAB_ingredients[i]); + BSP_LCD_DisplayStringAt(162*i,37, (uint8_t *)&Text, LEFT_MODE); + } + for(i=3; i<6; i++){ + char Text2[1]; + sprintf((char*)&Text2, "%d", TAB_ingredients[i]); + BSP_LCD_DisplayStringAt(162*i,149,(uint8_t *)&Text2, LEFT_MODE); + } + } + + bool Bouton(uint16_t Xpos, uint16_t Ypos, uint16_t Xdim, uint16_t Ydim,uint16_t x,uint16_t y){ if((x >= Xpos) && (x<= Xpos+Xdim ) && (y <= Ypos + Ydim) && (y>= Ypos )){ return true; @@ -18,14 +34,12 @@ BSP_LCD_DrawPixel(Xpos + j, Ypos + i, img[j + i*Largeur] + 0xFF000000); //j + i*Largeur } - } - } -void Page1() +void Page_Recette() { - BSP_LCD_Clear(LCD_COLOR_WHITE); + BSP_LCD_SetBackColor(LCD_COLOR_WHITE); BSP_LCD_SetTextColor(LCD_COLOR_BLACK); BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"Recettes", CENTER_MODE); @@ -34,7 +48,7 @@ -void Ingredients() +void Page_Ingredients() { AfficheImage(0,0,160,90,image1); AfficheImage(160,0,160,90,image2); @@ -55,10 +69,10 @@ { if(NumeroPage==0){ - Ingredients(); + Page_Ingredients(); } else if(NumeroPage == 1){ - Page1(); + Page_Recette(); } }