From 7deb8a36fd5e49e03ca614076363a81777ab7c42 Mon Sep 17 00:00:00 2001 From: sieja Date: Mon, 16 Jun 2025 22:14:57 +0200 Subject: [PATCH] LCD_RGB_graphicstest_eSPI --- .../LCD_RGB_graphicstest_eSPI.ino | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ESP32/LCD_RGB_graphicstest_eSPI/LCD_RGB_graphicstest_eSPI.ino diff --git a/ESP32/LCD_RGB_graphicstest_eSPI/LCD_RGB_graphicstest_eSPI.ino b/ESP32/LCD_RGB_graphicstest_eSPI/LCD_RGB_graphicstest_eSPI.ino new file mode 100644 index 0000000..cbfe2f2 --- /dev/null +++ b/ESP32/LCD_RGB_graphicstest_eSPI/LCD_RGB_graphicstest_eSPI.ino @@ -0,0 +1,39 @@ +#include +#include + + +// Wymaga konfiguracjie: +// C:\Users\siiee\Documents\Arduino\libraries\TFT_eSPI + +TFT_eSPI tft = TFT_eSPI(); // domyślna konfiguracja z User_Setup.h + +void setup() { + tft.init(); + tft.setRotation(1); + tft.fillScreen(TFT_BLACK); + + tft.setTextColor(TFT_YELLOW, TFT_BLACK); + tft.setTextSize(2); + tft.drawString("Witaj!", 10, 10); + + tft.drawLine(0, 0, 127, 159, TFT_RED); + tft.drawRect(5, 40, 118, 30, TFT_BLUE); + tft.fillRect(0, 0, 240, 240, TFT_BLACK); + +} + +void loop() { + static uint32_t last = 0; + if (millis() - last > 1000) { + last = millis(); + static int licznik = 0; + licznik++; + // tft.fillRect(10, 80, 100, 20, TFT_BLACK); + tft.drawString("Sekundy: " + String(licznik), 10, 0); + tft.drawString("Sekundy: " + String(licznik), 10, 20); + tft.drawString("Sekundy: " + String(licznik), 10, 40); + tft.drawString("Sekundy: " + String(licznik), 10, 60); + tft.drawString("Sekundy: " + String(licznik), 10, 80); + tft.drawString("Sekundy: " + String(licznik), 10, 100); + } +} \ No newline at end of file