#include <Adafruit_ILI9341.h>
#include <SPI.h>
// Pin connections for the display (adjust according to your wiring)
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8
// Create an instance of the ILI9341 display
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
// Initialize the display
tft.begin();
// Set the rotation (optional, adjust according to your display orientation)
tft.setRotation(3);
// Set the text color and size (optional)
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
// Clear the screen
// tft.fillScreen(ILI9341_BLACK);
// Draw a square
int startX1 = 0;
int startY1 = 30;
int sideLength1 = 160;
tft.fillRect(startX1, startY1, sideLength1, sideLength1, ILI9341_YELLOW);
// Draw a square
int startX2 = 160;
int startY2 = 30;
int sideLength2 = 160;
tft.fillRect(startX2, startY2, sideLength2, sideLength2, ILI9341_RED);
}
void loop() {
// Nothing to do here for a static display
}