#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
// Define the pins for Arduino Mega
#define TFT_CS 53 // Chip select control pin
#define TFT_RST 49 // Reset pin
#define TFT_DC 48 // Data/command control pin
// Create the ILI9341 object for the Mega
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
tft.begin(); // Initialize the display
tft.setRotation(0); // Set screen orientation
tft.fillScreen(ILI9341_BLACK); // Clear the screen with black color
Serial.begin(9600);
}
void loop() {
tft.setCursor(0, 0); // Set cursor to top-left corner
tft.setTextColor(ILI9341_WHITE); // Set text color to white
tft.setTextSize(3); // Set text size
tft.print("Hello, Wokwi!"); // Print text on the display
delay(2000); // Delay to make text stay visible
Serial.println("abcd");
}