#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#define ILI9341_DRIVER
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 2 // Data Command control pin
#define TFT_RST 4
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
void setup()
{
// initilizing tft to configure appropriately with controller
tft.init();
// set ESP32 pin to input mode
// this line of the code will fill screen with specific color, there are 24
// color defined in the espi libaray, can use custom color from banth development website
// select color and past the Hex 0x00FF number or type TFT_RED that is defined in TFT_eSPI library
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_WHITE);
tft.drawString("Jeewan Rai", 50, 20, 4);
tft.setTextColor(TFT_BLUE);
tft.drawString("Drive Division", 40, 50, 4);
tft.setTextColor(TFT_RED);
tft.drawString("InnoTech Department", 50, 75, 2);
tft.setTextColor(TFT_DARKGREEN, TFT_WHITE);
}
int count = 0;
void loop()
{
tft.drawString(String(distance_cm), 40, 100, 7);
}