#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <SPI.h>
#include <Fonts/FreeSansBold12pt7b.h>
#include <Fonts/FreeSerifItalic12pt7b.h>
#include <Fonts/FreeMonoBold18pt7b.h>
#include <Fonts/FreeSansOblique12pt7b.h>
#define TFT_CS 5
#define TFT_RST 4
#define TFT_DC 2
#define TFT_SCLK 12
#define TFT_MOSI 11
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
void setup() {
Serial.begin(115200);
tft.init(240, 280); // Init ST7789 280x240
tft.setRotation(2);
tft.fillScreen(ST77XX_BLACK);
}
void loop() {
// --- Code 1: Fear of Failure ---
tft.fillScreen(ST77XX_BLACK);
tft.setFont(&FreeMonoBold18pt7b);
tft.setTextColor(ST77XX_RED);
tft.setCursor(10, 120);
tft.println("Fear of Failure");
delay(1200);
tft.setFont(&FreeSansBold12pt7b);
tft.setTextColor(ST77XX_WHITE);
tft.setCursor(10, 160);
tft.println("Courage brings success!");
delay(1500);
// --- Code 2: Fear of Rejection ---
tft.fillScreen(ST77XX_BLACK);
tft.setFont(&FreeSansOblique12pt7b);
tft.setTextColor(ST77XX_GREEN);
tft.setCursor(10, 120);
tft.println("Fear of Rejection");
delay(1200);
tft.setFont(&FreeSerifItalic12pt7b);
tft.setTextColor(ST77XX_WHITE);
tft.setCursor(10, 160);
tft.println("Confidence wins respect!");
delay(1500);
// --- Code 3: Fear of Change ---
tft.fillScreen(ST77XX_BLACK);
tft.setFont(&FreeMonoBold18pt7b);
tft.setTextColor(ST77XX_BLUE);
tft.setCursor(10, 140);
tft.println("Fear of Change");
delay(1200);
tft.setFont(&FreeSansBold12pt7b);
tft.setTextColor(ST77XX_WHITE);
tft.setCursor(10, 180);
tft.println("Adaptation creates growth!");
delay(1500);
// --- Code 4: Fear of Unknown ---
tft.fillScreen(ST77XX_BLACK);
tft.setFont(&FreeSansOblique12pt7b);
tft.setTextColor(ST77XX_CYAN);
tft.setCursor(10, 160);
tft.println("Fear of Unknown");
delay(1200);
tft.setFont(&FreeSerifItalic12pt7b);
tft.setTextColor(ST77XX_WHITE);
tft.setCursor(10, 200);
tft.println("Exploration reveals opportunity!");
delay(1500);
}
Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1
#define TFT_CS 5
#define TFT_RST 4
#define TFT_DC 2
#define TFT_SCLK 12
#define TFT_MOSI 11
https://wokwi.com/projects/466165238744007681