esp32的arduino官方在线文档:https://docs.espressif.com/projects/arduino-esp32/en/latest/index.html
esp32d arduino官方github:https://github.com/espressif/arduino-esp32
库地址:https://github.com/Bodmer/TFT_eSPI

1,arduino先下载esp32支持包
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
2,下载TFT_eSPI库
3,修改库文件User_Setup.h
//打开这个注释,因为我用的是ILI9486
#define ILI9486_DRIVER
//然后修改ESP32的连接引脚,这里是默认的VSPI
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 2 // Data Command control pin
#define TFT_RST 4 // Reset pin (could connect to RST pin)
#define TOUCH_CS 25 //触摸cs引脚
// The ESP32 has 2 free SPI ports i.e. VSPI and HSPI, the VSPI is the default.
// If the VSPI port is in use and pins are not accessible (e.g. TTGO T-Beam)
// then uncomment the following line:
//这里不开启,如果vspi引脚被占用,可以开启这里,然后修改上面的引脚号
//#define USE_HSPI_PORT
4,连线按上面宏定义连就可以了。
其中LED引脚可以接个电阻连到vcc,或者连到IO引脚控制,甚至
备注:HSPI和VSPI的默认引脚如下图

https://blog.csdn.net/qq_41868901/article/details/105050371
声明:
本文采用
BY-NC-SA
协议进行授权,如无注明均为原创,转载请注明转自
走着的小站
本文地址: ARDUINO ESP32驱动SPI TFT4.0寸屏幕ILI9486+XPT2046使用TFT_eSPI库
本文地址: ARDUINO ESP32驱动SPI TFT4.0寸屏幕ILI9486+XPT2046使用TFT_eSPI库