#include <TFT_eSPI.h> // Include the TFT_eSPI library
// Pin configuraton for ESP32
#define TFT_CS 5 // Chip select control pin
#define TFT_RST 2 // Reset pin (could connect to RST pin)
#define TFT_DC 15 // Data Command control pin
// Create an instance of the library
TFT_eSPI tft = TFT_eSPI();
void setup() {
// Initialize the display
tft.init();
// Set rotation of the display (optional)
tft.setRotation(1);
// Fill the screen with a color (optional)
tft.fillScreen(TFT_BLACK);
// Set text color
tft.setTextColor(TFT_WHITE);
// Set text size
tft.setTextSize(2);
// Set cursor position (optional)
tft.setCursor(10, 10);
// Print the desired text
tft.println("Hello, ILI9341!");
}
void loop() {
// Nothing here, as we only want to print the text once in setup
}