Bodmer / TFT_eSPI

Arduino and PlatformIO IDE compatible TFT library optimised for the Raspberry Pi Pico (RP2040), STM32, ESP8266 and ESP32 that supports different driver chips
Other
3.53k stars 1.02k forks source link

Display problem on a TTGO T-display #1484

Closed kalon33 closed 2 years ago

kalon33 commented 2 years ago

Using a TTGO T-display, I got only part of the display used, with the remaining of the display with glitches. T-display is properly chosen in User_Setup_Select.h.

I tried rotating without success. It also seems that the colors are inverted, as I should got that result:

screenshot

But got this one: IMG_20211212_123654

For more info about my board, I took a picture from the other side: IMG_20211212_123701

Could you help me fix that problem? Thanks!

Bodmer commented 2 years ago

I have an identical looking board and it seems to work fine with setup 25 and the library examples.

To test for colour run the Test and diagnostics example Colour_Test. This is what you should see:

screenshot_2021_12_12_19_35_36

To check your setup file is correctly selected run the Read_User_Setup example and look at the serial monitor output. Here's a copy of what I see when I do this (with latest Github version of library):

TFT_eSPI ver = 2.3.88
Processor    = ESP32
Frequency    = 240MHz
Transactions = Yes
Interface    = SPI
Display driver = 7789
Display width  = 135
Display height = 240

R0 x offset = 52
R0 y offset = 40
MOSI    = GPIO 19
SCK     = GPIO 18
TFT_CS   = GPIO 5
TFT_DC   = GPIO 16
TFT_RST  = GPIO 23

TFT_BL           = GPIO 4
TFT_BACKLIGHT_ON = HIGH

Font GLCD   loaded
Font 2      loaded
Font 4      loaded
Font 6      loaded
Font 7      loaded
Font 8      loaded
Smooth font enabled

Display SPI frequency = 40.00

If this looks good then I will need a complete example sketch that demonstrates the problem to see where the problem is.

kalon33 commented 2 years ago

[code] TFT_eSPI ver = 2.3.70 Processor = ESP32 Frequency = 240MHz Transactions = Yes Interface = SPI Display driver = 9341 Display width = 240 Display height = 320

MOSI = GPIO 19 SCK = GPIO 18 TFT_CS = GPIO 5 TFT_DC = GPIO 16 TFT_RST = GPIO 23

TFT_BL = GPIO 4 TFT_BACKLIGHT_ON = HIGH

Font GLCD loaded Font 2 loaded Font 4 loaded Font 6 loaded Font 7 loaded Font 8 loaded Smooth font enabled

Display SPI frequency = 40.00 [/code]

Could it be possible that I don't have the appriopriate driver?

kalon33 commented 2 years ago

For the color test, I got that with setup 25: IMG_20211213_171300 IMG_20211213_171257

Bodmer commented 2 years ago

The following lines indicate the setup file is not correct:

Display driver = 9341
Display width = 240
Display height = 320

This should read the same as mine, viz:

Display driver = 7789
Display width  = 135
Display height = 240

R0 x offset = 52
R0 y offset = 40

Probably this line has not been commented out? Typically this leads to warning message during compile time but you will need to check that only ONE setup file is being called up.

kalon33 commented 2 years ago

@Bodmer : That was the problem... Sorry... Thanks a lot for your help!

Bodmer commented 2 years ago

No problem. Have made the same mistake myself!

Simeonhm commented 1 month ago

Hello I have this problem. Can someone help me?

With this code in main.cpp:

include

include

TFT_eSPI tft = TFT_eSPI();

void setup() { tft.begin(); tft.setRotation(1); tft.fillScreen(TFT_RED); }

void loop() {

}

I get this: WhatsApp Image 2024-05-14 at 14 48 53