Problème méthode TFT

Yop!
Je veux utiliser un TFT pour un projet et j'ai un écran de départ (start) que l'on clique pour accéder au menu à proprement parler.
Le menu start se dessine mais un écran blanc ensuite apparaît puis plus rien :confused:. Quelqu'un aurait-il une idée de ce qui cause ça ? Le code est en pièce jointe si vous voulez jeter un coup d'oeil.

Merci beaucoup en avance

Yapa de pièce jointe. Le mieux est de mettre le code non pas en pièce jointe ni en fichier attaché mais ente balises code. Tout est expliqué dans les messages épinglés en haut du forum Français.
Un code entre balises code est plus facile à lire, notamment depuis un téléphone portable, ce qui arrive parfois aux membres du forum. Merci

Re, merci du conseil voilà le code entre balises du coup :wink:

//Bibliothèques
#include <Adafruit_GFX.h>  
#include <Adafruit_TFTLCD.h> 
#include <TouchScreen.h>
#include <MCUFRIEND_kbv.h>
#include <RCSwitch.h>
//Pins de l'ecran
#define LCD_CS A3 
#define LCD_CD A2
#define LCD_WR A1 
#define LCD_RD A0 
#define LCD_RESET A4
//definitions des couleurs
#define  BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
#define ILI9341_BLACK       0x0000      
#define ILI9341_NAVY        0x000F      
#define ILI9341_DARKGREEN   0x03E0      
#define ILI9341_DARKCYAN    0x03EF      
#define ILI9341_MAROON      0x7800      
#define ILI9341_PURPLE      0x780F      
#define ILI9341_OLIVE       0x7BE0      
#define ILI9341_LIGHTGREY   0xC618     
#define ILI9341_DARKGREY    0x7BEF      
#define ILI9341_BLUE        0x001F      
#define ILI9341_GREEN       0x07E0      
#define ILI9341_CYAN        0x07FF      
#define ILI9341_RED         0xF800    
#define ILI9341_MAGENTA     0xF81F     
#define ILI9341_YELLOW      0xFFE0      
#define ILI9341_WHITE       0xFFFF      
#define ILI9341_ORANGE      0xFD20      
#define ILI9341_GREENYELLOW 0xAFE5      
#define ILI9341_PINK        0xF81F

//definition fonction tactile
#define YP A2  
#define XM A3  
#define YM 8   
#define XP 9   
#define TS_MINX 130
#define TS_MAXX 905
#define TS_MINY 75
#define TS_MAXY 930
#define MINPRESSURE 10
#define MAXPRESSURE 1000
//initialisation objet ecran
MCUFRIEND_kbv tft;
RCSwitch mySwitch = RCSwitch();
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
//création des boutons
#define BUTTON_X 20
#define BUTTON_Y 20
#define BUTTON_W 100
#define BUTTON_H 80
#define BUTTON_SPACING_X 180
#define BUTTON_SPACING_Y 150
#define TWO_BUTTON_SPACING_X 180
#define TWO_BUTTON_SPACING_Y 150

#define BUTTON_TEXTSIZE 2
//variable dessin
String page;
//fonctions
void start(void);
void  drawHomeIcon(void);
void  StatusBar(void);
void  Touch();
void  Menu1(void);

void setup() {
  mySwitch.enableTransmit(10); 
  delay(2000);
  uint16_t identifier = tft.readID();
  tft.reset();
  tft.begin(identifier);
  tft.setRotation(0);
  tft.fillScreen(BLACK);
  delay(1);
  start();
  Serial.begin(9600);
  }

void loop() {
  Touch();
}

/*--------------------------------------------------------------------------- dessin*/
void  drawHomeIcon() {                     /*  DRAW HOME ICON  */

  tft.fillTriangle(5, 15, 25, 0, 44, 15, ILI9341_DARKGREY);    //  roof background
  tft.drawTriangle(5, 15, 25, 0, 44, 15, BLACK);       //  roof border
  tft.fillRect(31, 2, 7, 10, RED);                     //  chimeney background
  tft.drawRect(31, 2, 7, 10, BLACK);                   //  chimeney border
  tft.fillRect(5, 15, 40, 24, WHITE);                  //  house background
  tft.drawRect(5, 15, 40, 24, BLACK);                  //  house border
  tft.fillRect(19, 22, 13, 16, RED);                   //  door background
  tft.drawRect(19, 22, 13, 16, BLACK);                 //  door border
}

void start()
{
  tft.drawCircle(tft.width() / 2, tft.height() / 2 + 30, 120, CYAN);
  tft.fillCircle(tft.width() / 2, tft.height() / 2 + 30, 116, YELLOW);
  tft.fillCircle(tft.width() / 2, tft.height() / 2 + 30, 100, BLACK);
  tft.fillCircle(tft.width() / 2, tft.height() / 2 + 30, 80, CYAN);
  tft.fillCircle(tft.width() / 2, tft.height() / 2 + 30, 75, BLACK);
  tft.setCursor(115, 260);
  tft.setTextColor(WHITE);
  tft.setTextSize(3);
  tft.print("START");
  tft.fillRoundRect(15, 419, 283, 48, 10, CYAN);
  tft.setCursor(90, 432);
  tft.setTextColor(BLACK);
  tft.setTextSize(2);
  tft.print("S H A - 2017");
  page = "start";
} 

void Menu1()
{
  tft.fillRect(0,0,320,480,BLACK);
  StatusBar();
  page = "Menu1";
}

void  StatusBar()  
{

  tft.fillRect(0, 0, 480, 40, CYAN);             //  Draw Status Bar background
  tft.drawRect(0, 0, 320, 480, WHITE);
  drawHomeIcon();
}
/*  if  (CurrentPage != "Home") {
    drawHomeIcon();
  }
*/

void Touch()
{
  pinMode(XM, OUTPUT);
  pinMode(YP, OUTPUT);  
  TSPoint p = ts.getPoint();
  if (p.z > MINPRESSURE && p.z < MAXPRESSURE) 
  {
  p.x = map(p.x, TS_MINX, TS_MAXX, 0, tft.width());
  p.y = map(p.y, TS_MINY, TS_MAXY, 0, tft.height());
  } 
//partie retour
   if  (page != "start" && 339<p.y > 310 && 60<p.x > 0) 
   {    
                              
        start();   
   }
   if  (page == "start" && 100<p.x<150 && 240<p.y<280) 
   {                           
        
        tft.fillRect(0,0,320,480,BLACK);
        Menu1();
        Serial.print("debut start");
   }
   
}

Test tests me semblent louches :

   if  (page != "start" && 339<p.y > 310 && 60<p.x > 0) 
   ...
   if  (page == "start" && 100<p.x<150 && 240<p.y<280)

"60<p.x > 0" ça teste si p.x>0 et p.x>60
Ensuite, je ne sais pas si le double test (encadrement) est valide en C, tu devrais simplifier tes tests :

if  (page == "start" && 100<p.x && p.x<150 && 240<p.y && p.y<280)

ok je vais essayer ça et je te tiens au courant, merci du conseil :wink: