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

esp32 cam 1.44寸TFT彩屏 ST7735S驱动 TFT_eSPI库驱动_第1张图片

esp32 cam 1.44寸TFT彩屏 ST7735S驱动 TFT_eSPI库驱动_第2张图片

esp32 cam 1.44寸TFT彩屏 ST7735S驱动 TFT_eSPI库驱动_第3张图片

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

ESP32 CAM TFT 1.44
5V VCC
GND GND
GND
NC
NC
5V BLC
D14 SCL
D15 SDA
D13 DC
D2 RESET
D12 CS

安装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 
#include 

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:

}

你可能感兴趣的:(tv)