LCD_RGB_graphicstest_eSPI
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#include <TFT_eSPI.h>
|
||||
#include <SPI.h>
|
||||
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user