1.8 tft 128*160 lcd error

Forget about the TFT.h library. It is crap.

  1. Post a link to the actual display that you have bought.

  2. Install Adafruit_ST7735 and Adafruit_GFX via the IDE Library Manager.

  3. Run the examples. Select the Software SPI constructor to suit your ESP32 wiring.

  4. Then connect the Hardware SPI wiring e.g.

#define TFT_MOSI 23
#define TFT_MISO 19
#define TFT_SCK  18
#define TFT_SS   5
#define TFT_DC   13     //
#define TFT_RESET 12   //
  1. Run the examples with the HW SPI constructor.

This might sound a bit complicated. When we have links to your actual hardware i.e. display board and ESP32 board, we can walk you through every step.

David.