ESP32 LCD ILI9341 problem

StickPaperTime
Posts: 2
Joined: Wed Aug 25, 2021 12:42 am

ESP32 LCD ILI9341 problem

Postby StickPaperTime » Wed Aug 25, 2021 1:00 am

hello,
I had a project using display ili9341 at the first page the LCD displaying the button, but when I touch it the display turning to white but the touch screen still working.
the button supposed to change the page from 1 to 2 sometimes the display working well but in some case the lcd turning white.
is there's any solution for my problem ?
sorry for my bad english

here is the sketch
uint16_t x, y;
int pressed = tft.getTouch(&x, &y);

if (pressed) {
if (itemAvailable_1 > 0 ) {//cola
if ((x > 66) && (x < 114)) {
if ((y > 173) && (y < 206)) {
Serial.println("button press 1");
selected_item = '1';
price = 5;
tft.fillRect(120, 8, 76, 83, TFT_WHITE);
item();
}
}
}

void item() {
tft.setFreeFont(CF_Pixel);
tft.setTextColor(TFT_BLACK, TFT_WHITE);

if (selected_item == '1') {
tft.pushImage(140, 16, 38, 64, bottle);
tft.drawString("Cola", 140, 84, 1);
}
if (selected_item == '2') {
tft.pushImage(140, 16, 38, 64, bottle);
tft.drawString("Sprite", 144, 84, 1);
}
if (selected_item == '3') {
tft.pushImage(140, 16, 38, 64, bottle);
tft.drawString("Mix", 148, 84, 1);
}

if (selected_item >= '1') {
tft.pushImage(7, 41, 34, 27, reset_Button);
tft.pushImage(270, 8, 34, 27, buy_Button);
}

if (selected_item == '0') {
tft.fillRect(120, 8, 76, 83, TFT_WHITE);
tft.fillRect(7, 41, 34, 29, TFT_WHITE);
tft.fillRect(270, 8, 34, 27, TFT_WHITE);
}

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 LCD ILI9341 problem

Postby ESP_Sprite » Wed Aug 25, 2021 1:47 am

Possibly a bad connection that gets triggered by you touching the screen?

StickPaperTime
Posts: 2
Joined: Wed Aug 25, 2021 12:42 am

Re: ESP32 LCD ILI9341 problem

Postby StickPaperTime » Sat Aug 28, 2021 12:36 pm

Sorry for late replied, I found the problem in my project I'm running 2 HX711 and makes ESP32 little lag. When ESP32 lag and the TFT changing the screen then the display will be come to white

Who is online

Users browsing this forum: No registered users and 99 guests