TFT_eSPI库的使用
🚀硬件准备
以分辨率为 240x240 的 SPI 接口的 TFT 屏幕为例,其驱动芯片为ST7789,与ESP32的硬件连接如下图所示:
其中 DC 接到了IO2、RES 接到了 IO4、MOSI 接到了 IO23、SCK 接到了 IO18。
🚀User_Setup.h 文件的修改
首先选择对应的驱动芯片,取消其宏定义的注释。
🚀User_Setup_Select.h文件的修改
然后进入 User_Setup_Select.h ,找到对应分辨率和驱动芯片的头文件,取消其注释。
本次选择的是 Setup24_ST7789.h
🚀Setup24_ST7789.h文件的修改
进入 User_Setups 目录,找到并打开 Setup24_ST7789.h 。
修改分辨率和引脚即可。
🚀测试例程
1 |
|
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Cokode' Blog!