esp32 cam 1.44寸TFT彩屏 ST7735S驱动 TFT_eSPI库驱动

 ESP32 CAM引脚与TFT1.44(ST7735S)引脚接线

ESP32 CAMTFT 1.44
5VVCC
GNDGND
GND
NC
NC
5VBLC
D14SCL
D15SDA
D13DC
D2RESET
D12CS

安装TFT_eSPI库驱动

Arduino-工具-管理库-搜索TFT_eSPI-安装TFT_eSPI

修改驱动,找到以下代码
//#define ST7735_DRIVER      // Define additional parameters below for this display
改为
define ST7735_DRIVER      // Define additional parameters below for this display

修改分辨率
//#define ST7735_GREENTAB128    // For 128 x 128 display
改为
#define ST7735_GREENTAB128    // For 128 x 128 display

修改引脚
找到以下代码
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
#define TFT_CS   PIN_D8  // Chip select control pin D8
#define TFT_DC   PIN_D3  // Data Command control pin
#define TFT_RST  PIN_D4  // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST  -1    // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V

全部注释掉,添加以下代码
#define TFT_MOSI 15
#define TFT_SCLK 14
#define TFT_CS   12
#define TFT_DC   13
#define TFT_RST  2

修改配置文件User_Setup.h

#include <SPI.h>
#include <TFT_eSPI.h>

TFT_eSPI tft = TFT_eSPI();  // 调用自定义库

void setup() {
  // put your setup code here, to run once:

  tft.init();//屏幕初始化
  // 将“光标”设置在显示屏的左上角(0,0),然后选择字体4
  tft.setCursor(0, 0, 4);

  // 将字体颜色设置为白色,背景为黑色
  tft.setTextColor(TFT_WHITE, TFT_BLACK);

  tft.fillScreen(TFT_BLACK);//填充屏幕

  tft.println("White text");
}

void loop() {
  // put your main code here, to run repeatedly:

}

  • 6
    点赞
  • 57
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值