Kód: Vybrat vše
//0x0000 Black
//0xFFFF White
//0xBDF7 Light Gray
//0x7BEF Dark Gray
//0xF800 Red
//0xFFE0 Yellow
//0xFBE0 Orange
//0x79E0 Brown
//0x7E0 Green
//0x7FF Cyan
//0x1F Blue
//0xF81F Pink
#include <Adafruit_GFX.h> // Hardware-specific library
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;
void setup()
{
// Serial.begin(9600);
tft.reset();
uint16_t identifier = tft.readID();
if (identifier == 0xEFEF) identifier = 0x9486;
tft.begin(identifier);
tft.fillScreen(0x0000);
}
void loop()
{
tft.setRotation(1);
//dokola
tft.drawLine(0, 0, 479, 0, 0xFFFF);
tft.drawLine(1, 1, 478, 1, 0xFFFF);
tft.drawLine(2, 2, 477, 2, 0xFFFF);
tft.drawLine(479, 0, 479, 319, 0xFFFF);
tft.drawLine(478, 1, 478, 318, 0xFFFF);
tft.drawLine(477, 2, 477, 317, 0xFFFF);
tft.drawLine(479, 319, 0, 319, 0xFFFF);
tft.drawLine(478, 318, 1, 318, 0xFFFF);
tft.drawLine(477, 317, 2, 317, 0xFFFF);
tft.drawLine(0, 319, 0, 0, 0xFFFF);
tft.drawLine(1, 318, 1, 1, 0xFFFF);
tft.drawLine(2, 317, 2, 2, 0xFFFF);
tft.drawLine(240, 0, 240, 70, 0xFFFF);
tft.drawLine(241, 1, 241, 70, 0xFFFF);
tft.drawLine(0, 70, 479, 70, 0xFFFF);
tft.drawLine(1, 71, 479, 71, 0xFFFF);
tft.setTextSize(2);
tft.setCursor(310, 5);
tft.setTextColor(0xFBE0);
tft.println("Spotreba");
tft.setCursor(245, 25);
tft.setTextColor(0xBDF7);
tft.println("Aktualni = ");
tft.setCursor(245, 45);
tft.setTextColor(0xBDF7);
tft.println("Celkova = ");
}