snapshot
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#include <TFT_eSPI.h>
|
||||
#include <SPI.h>
|
||||
|
||||
TFT_eSPI tft = TFT_eSPI();
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
tft.init();
|
||||
tft.setRotation(1); // Landscape
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
tft.setTextSize(2);
|
||||
tft.drawString("Hello from ESP32!", 20, 20);
|
||||
tft.fillCircle(160, 120, 50, TFT_BLUE);
|
||||
Serial.println("Display initialized!");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Touch test
|
||||
uint16_t x, y;
|
||||
if (tft.getTouch(&x, &y)) {
|
||||
Serial.printf("Touch at: %d, %d\n", x, y);
|
||||
tft.fillCircle(x, y, 3, TFT_RED);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user