由于 本身的屏幕 被烧了,因此只能使用,新的屏幕,但是新的屏幕参数,和针脚定义 不是很多。最后在 简书文档中,大概知道 定义 ,附近针脚应该不多,因此,显示正常了!
感觉是能成功,但是现在还是乱码!
Arduino_DataBus *bus = new Arduino_ESP32SPI(4 /* DC */, 5 /* CS */, 18 /* SCK */, 17 /* MOSI */, GFX_NOT_DEFINED /* MISO */);
Arduino_GFX *gfx = new Arduino_ST7789(bus, 2 /* RST */, 1 /* rotation */, true /* IPS */, 170 /* width */, 320 /* height */, 35 /* col offset 1 */, 0 /* row offset 1 */, 35 /* col offset 2 */, 0 /* row offset 2 */);
#include <Arduino_GFX_Library.h>
Arduino_DataBus *bus = new Arduino_ESP32SPI(5 /* DC */, 4 /* CS */, 18 /* SCK */, 17 /* MOSI */, GFX_NOT_DEFINED /* MISO */);
Arduino_GFX *gfx = new Arduino_ST7789(bus, 2 /* RST */, 1 /* rotation */, true /* IPS */, 170 /* width */, 320 /* height */, 35 /* col offset 1 */, 0 /* row offset 1 */, 35 /* col offset 2 */, 0 /* row offset 2 */);
void setup(void)
{
gfx->begin();
gfx->fillScreen(BLUE);
pinMode(11, OUTPUT);//背光
digitalWrite(11, HIGH);
gfx->setCursor(0, 10);
gfx->setTextColor(RED,YELLOW);
gfx->setTextSize(2);
gfx->println("zhenxi demo");
delay(1000);
}
void loop()
{
gfx->setCursor(10, 70);
gfx->print(millis());
delay(100);
}
dc 和cs 线接反了。现在正常了!
接反效果
参考文档
ESP32使用Arduino_GFX点亮1.54寸IPS全视角TFT屏幕-电子发烧友网
ESP32系列之LVGL(一):ESP32S3+ST7789点屏_esp32s3 st7789屏幕-CSDN博客
使用DOIT ESP32 DEVKIT V1驱动屏幕ST7789的踩坑之旅 - 简书 重点参考
https://item.taobao.com/item.htm?_u=kc6u1fib530&id=737124744016&spm=a1z09.2.0.0.27232e8d2DAW4c