// *******************************************************************
// Simple Touch Drawing sample for WT32-SC01
// TFT_eSPI library
// -------------------------------------------------------------------
// Board configuration
// LCD (ST7796)
// #define ST7796_DRIVER
// #define TFT_WIDTH 480
// #define TFT_HEIGHT 320
// #define DISPLAY_WIDTH 320
// #define DISPLAY_HEIGHT 240
// #define TFT_BACKLIGHT_ON HIGH
// #define USE_HSPI_PORT
// #define TFT_MISO 12
// #define TFT_MOSI 13
// #define TFT_SCLK 14
// #define TFT_CS 15
// #define TFT_DC 21
// #define TFT_RST 22
// #define TFT_BL 23
// #define PIN_SDA 18
// #define PIN_SCL 19
// Touch (FT6336U)
// #define TOUCH_CS PIN_D2 // Chip select pin (T_CS) of touch screen
// I2C_TOUCH_ADDRESS=0x38
// SPI frequency for TFT writes
// #define SPI_FREQUENCY 27000000
// Optional reduced SPI frequency for reading TFT
// #define SPI_READ_FREQUENCY 20000000
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
// #define SPI_TOUCH_FREQUENCY 2500000
// *******************************************************************
// *******************************************************************
// ESP32, LCD-IL9341, SPI, Arduino GFX Library
// LED pin connected to VCC
// Fill screen with color and print Hello world
// millis = 1160
// *******************************************************************
//#define TFT_RGB_ORDER TFT_BGR // color order Blue-Green-Red - for this specific display
#include <TFT_eSPI.h>
#include <SPI.h>
//#include <Wire.h>
//#include <Adafruit_ILI9341.h>
//#define TFT_WIDTH 480
//#define TFT_HEIGHT 320
#define BLACK 0x000F
#define BLUE 0x001F
#define CYAN 0x07FF
#define WHITE 0xFFFF
// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins
#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 // 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
//#define TOUCH_CS 5
//#define ILI9341_DRIVER
unsigned long Start = 0;
unsigned long End = 0;
unsigned long Time = 0;
//Adafruit_ILI9341 display = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
TFT_eSPI tft = TFT_eSPI();
// *******************************************************************
void setup(void)
{
Serial.begin(38400);
Serial.print("Time: ");
Start = millis();
//tft.init();
tft.begin();
tft.invertDisplay( true ); // Where invert is true or false
//tft.setRotation(1);
tft.fillScreen(CYAN);
// delay(1000);
//tft.fillScreen(WHITE);
//tft.setCursor(0, 0);
//tft.setTextFont(1);
tft.setTextSize(4);
//tft.setTextColor(WHITE, BLACK);
tft.print("Hello world");
//tft.print(F("Hello world"));
//tft.drawString("[xox]", 20, 20, 1);
// delay(3000);
End = millis();
Time = End - Start;
Serial.print(Time, DEC);
}
// *******************************************************************
void loop()
{
}