#include <TFT_eSPI.h> // Include the graphics library (this includes the sprite functions)
// Create an instance of the library
TFT_eSPI tft = TFT_eSPI();
void setup() {
// Initialize the display
tft.init();
tft.setRotation(1);
// Clear the screen to black
tft.fillScreen(TFT_BLACK);
}
void loop() {
// Example: Draw a red rectangle
tft.fillRect(10, 10, 100, 50, TFT_RED);
// Example: Draw some text
tft.setTextColor(TFT_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 70);
tft.print("Hello, World!");
delay(5000); // Wait for 5 seconds
}