#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
// Định nghĩa các chân kết nối
#define TFT_CS 5
#define TFT_RST 21
#define TFT_DC 4
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_MISO 19
// Khởi tạo đối tượng màn hình ILI9341
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
Serial.begin(115200);
tft.begin();
// Xóa màn hình với màu trắng
tft.fillScreen(ILI9341_WHITE); //màu màn hình nền
tft.setTextColor(ILI9341_BLACK); //màu chữ
tft.setTextSize(2); //cỡ chữ
tft.setCursor(50, 120); // Tại tọa độ (50, 120)
tft.println("Hello, Admin!"); //hiển thị văn bản
tft.setCursor(50, 150); // Tại tọa độ (50, 150)
tft.println("Welcome back");//hiển thị văn bản
}
void loop() {
delay(100); // Delay 100ms để chương trình chạy liên tục
}