#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <SPI.h>
#define TFT_DC 39
#define TFT_CS 7
#define TFT_MOSI 35
#define TFT_SCK 36
#define TFT_MISO 37
#define TFT_LED 45
#define TFT_RESET 40
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCK, TFT_RESET, TFT_MISO);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("\n\nHello, ESP32-S3!");
Serial.println("ILI9341 test");
// Turn on backlight
pinMode(TFT_LED, OUTPUT);
digitalWrite(TFT_LED, HIGH);
// Init display
tft.begin();
tft.setRotation(1);
// tft.fillScreen(ILI9341_BLACK);
// uint8_t x = tft.readcommand8(ILI9341_RDMODE);
// Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
Serial.println("Setup complete");
}
void loop() {
// put your main code here, to run repeatedly:
// test text
tft.fillScreen(ILI9341_BLACK);
Serial.println("Test text starting");
/*
tft.setCursor(0, 0);
tft.setTextColor(ILI9341_WHITE); tft.setTextSize(1);
tft.println("Hello World!");
tft.setTextColor(ILI9341_YELLOW); tft.setTextSize(2);
tft.println(1234.56);
tft.setTextColor(ILI9341_RED); tft.setTextSize(3);
tft.println(0xDEADBEEF, HEX);
tft.println();
tft.setTextColor(ILI9341_GREEN);
tft.setTextSize(5);
tft.println("Groop");
tft.setTextSize(2);
tft.println("I implore thee,");
tft.setTextSize(1);
tft.println("my foonting turlingdromes.");
tft.println("And hooptiously drangle me");
tft.println("with crinkly bindlewurdles,");
tft.println("Or I will rend thee");
tft.println("in the gobberwarts");
tft.println("with my blurglecruncheon,");
tft.println("see if I don't!");
*/
tft.setCursor(0, 0);
tft.setTextColor(ILI9341_RED); tft.setTextSize(2);
tft.println("Adafruit Feather\n");
tft.setTextColor(ILI9341_YELLOW);
tft.println("ESP32-S3 TFT Demo\n");
tft.setTextColor(ILI9341_GREEN);
tft.print("Battery: ");
tft.setTextColor(ILI9341_WHITE);
tft.println("3.8V / 45%\n");
tft.setTextColor(ILI9341_BLUE);
tft.print("I2C: ");
tft.setTextColor(ILI9341_WHITE);
tft.print("0xB, 0x10");
Serial.println("Test text complete\n\n");
delay(10000); // this speeds up the simulation
}
Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1