Untitled
Anonymous
Plain Text
10/05/2026 5:49 PM
1.4 KB
8
Indexable
Never
#include <TFT_eSPI.h>
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI();
void setup() {
tft.init();
tft.setRotation(1);
tft.fillScreen(TFT_BLACK);
// =========================
// Border
// =========================
tft.drawRect(0, 0, tft.width(), tft.height(), TFT_CYAN);
// =========================
// Hello
// =========================
tft.setTextDatum(MC_DATUM);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.setTextFont(2);
tft.drawString("Hello!", tft.width() / 2, 18);
// =========================
// IoTNestBD
// =========================
tft.setTextColor(TFT_CYAN, TFT_BLACK);
tft.setTextFont(4);
tft.drawString("IoTNestBD", tft.width() / 2, 48);
// =========================
// Subtitle
// =========================
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
tft.setTextFont(2);
tft.drawString("Electronics & IoT", tft.width() / 2, 78);
// =========================
// Color bars
// =========================
int y = 95;
int h = 8;
tft.fillRect(10, y, 35, h, TFT_RED);
tft.fillRect(45, y, 35, h, TFT_GREEN);
tft.fillRect(80, y, 35, h, TFT_BLUE);
tft.fillRect(115, y, 35, h, TFT_YELLOW);
// =========================
// Footer
// =========================
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.setTextFont(1);
tft.drawString("ESP32 + ST7735S", tft.width() / 2, 118);
}
void loop() {
}Editor is loading...
Leave a Comment