#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_CLK 18
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 2 // Data Command control pin
#define TFT_RST 4 // Reset pin (could connect to RST pin)
#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
void setup() {
//Initialize TFT LCD
tft.begin();
//Rotate the screen to right direction
tft.setRotation(1);
}
//Main loop
void loop()
{
tft.setTextColor(ILI9341_BLACK);
tft.setTextSize(2);
//
tft.fillRect(0,0,150, 40,ILI9341_GREEN);
tft.setCursor(20,-10+20);
tft.print("AUTOMATIC");
//
tft.fillRect(0,40,110, 40,ILI9341_RED);
tft.setCursor(20,35+20);
tft.print("MANUAL");
//
tft.fillRect(0,80,170, 40,ILI9341_CYAN);
tft.setCursor(20,75+20);
tft.print("CALIBRATION");
}