#include <SPI.h>
#include <TFT_eSPI.h>
// In User_Setup.h:
#define TFT_MISO 9
#define TFT_MOSI 11
#define TFT_SCLK 7
#define TFT_CS 15
#define TFT_DC 2
#define TFT_RST 4
TFT_eSPI tft = TFT_eSPI(); // Create TFT object
void setup() {
tft.begin(); // Initialize TFT
tft.setRotation(3); // Set rotation (adjust if needed)
// Clear the screen
tft.fillScreen(TFT_BLACK);
// Display some shapes and text
tft.fillRect(10, 10, 100, 50, TFT_RED);
tft.drawCircle(120, 60, 30, TFT_GREEN);
tft.drawLine(200, 20, 240, 60, TFT_BLUE);
tft.drawTriangle(50, 120, 150, 120, 100, 180, TFT_YELLOW);
tft.drawPixel(150, 150, TFT_WHITE);
tft.setTextColor(TFT_WHITE);
tft.drawString("Hello TFT!", 50, 200);
}
void loop() {
// You can add more drawing functions or animations here
}
Loading
wemos-s2-mini
wemos-s2-mini