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.69k stars 1.07k forks source link

LILYGO® TTGO T-Display ESP32 CP2104 WiFi bluetooth Module Touch Screen Compiler problem #430

Closed Bushedo closed 4 years ago

Bushedo commented 5 years ago

Have been unable to get the touch screen to work with the Bodmer library although all other display code seems to work as intended. Keep getting "class TFT_eSPI has no member named getTouch". Have a Touch_CS line specified in the setup file, and moved the touch.h and .cpp files into main directory, but no luck. Can you offer any suggestions/help? Trying to run the example sketches, but none of touch screen items will compile. In User_Setup_Select: #include <User_Setups/TTGO_T_Display.h> In User_Setup:

define ST7789_DRIVER

define TFT_SDA_READ

define TFT_RGB_ORDER TFT_RGB

define TFT_WIDTH 135

define TFT_HEIGHT 240

define TFT_MOSI 19

define TFT_SCLK 18

define TFT_CS 5 // Chip select control pin

define TFT_DC 16 // Data Command control pin

define TFT_RST 2 // Reset pin (could connect to RST pin)

define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST

define TFT_BL 14 // LED back-light (only for ST7789 with backlight control pin)

define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen (NOT SURE THIS IS CORRECT

                                     PIN, BUT DON'T THINK COMPILER WOULD KNOW THE DIFFERENCE)
Bushedo commented 5 years ago

Well, it has been suggested that this device doesn't have a touch screen. Not sure what gave me the impression it did. Wasted a lot of time. That would explain why I couldn't identify a chip to manage the touch screen on the schematic. Thanks anyway.

BirdAPI commented 5 years ago

@Bushedo I think your confusion probably comes from their pinout image. The touch pins are actually referring to the ESP32's native capacitive touch sensors.

Here is a random tutorial online about them

Bushedo commented 5 years ago

BirdAPI, You may be right or I saw a post from someone with a different board that had a touch screen. Thanks.

Bodmer commented 4 years ago

The library only compiles in the touch support routines if TOUCH_CS is defined, make sure you have included it in the right setup file. Only one setup file should be called up.

As you found the T Display does not have a touch screen.