ESP32 TFT显示器 — ESP32-S3 simulation

An interactive ESP32-S3 circuit simulation you can run free in your browser on Velxio, by xanderisme.

Components

Sketch code

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>

// 严格对应画布连线
#define TFT_CS   10
#define TFT_DC   8
#define TFT_RST  9

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  Serial.begin(115200);
  Serial.println("开始测试 2.8寸 TFT...");

  tft.begin();
  tft.setRotation(0); // 横屏(如果发现字是倒的或竖的,改成 0 或 3)

  // 1. 刷红屏(1秒)
  tft.fillScreen(ILI9341_RED);
  delay(1000);

  // 2. 刷黑屏
  tft.fillScreen(ILI9341_BLACK);

  // 3. 显示文字
  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(3);
  tft.setCursor(20, 50);
  tft.println("Velxio TFT");
  
  tft.setTextColor(ILI9341_YELLOW);
  tft.setTextSize(2);
  tft.setCursor(20, 100);
  tft.println("ILI9341 Test");
  
  tft.setCursor(20, 140);
  tft.println("Ready!");

  Serial.println("屏幕初始化完成!");
}

void loop() {
  // 闪烁边框,证明程序在跑
  tft.drawRect(0, 0, 320, 240, ILI9341_BLUE);
  delay(500);
  tft.drawRect(0, 0, 320, 240, ILI9341_BLACK);
  delay(500);
}

More projects by xanderisme