#include <Adafruit_GFX.h> // Include core graphics library
#include <Adafruit_ILI9341.h> // Include the specific TFT library
// Pin definitions
#define TFT_CS 10 // Chip select
#define TFT_RST 9 // Reset
#define TFT_DC 8 // Data/Command
// Create an instance of the TFT display
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
// Start serial communication for debugging
Serial.begin(9600);
// Initialize TFT display
tft.begin();
}
void loop() {
tft.fillScreen(ILI9341_BLACK);
tft.fillRect(50, 50, 100, 100, ILI9341_RED);
tft.fillCircle(160, 120, 50, ILI9341_BLUE);
// Draw some text
tft.setTextColor(ILI9341_WHITE); // Text color
tft.setTextSize(2); // Text size
tft.setCursor(10, 10); // Text position
tft.print("Hello, TFT!");
}