#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <Fonts/FreeSans24pt7b.h>
#include <Fonts/FreeSans18pt7b.h>
// https://github.com/WaylandM/XOD_ArduinoFreeFontFile
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
void setup()
{
tft.begin();
tft.setRotation(1);
tft.setTextColor(ILI9341_BLACK);
ekranSmarowanieZa(133);
delay(10000);
//ekranBrakSmarowania();
}
void loop() {
}
void ekranSmarowanieZa(uint16_t godziny)
{
tft.fillScreen(ILI9341_GREEN);
tft.setFont(&FreeSans24pt7b);
tft.setCursor(60, 30);
tft.println("SMES");
tft.setFont(&FreeSans18pt7b);
tft.setCursor(40, 100);
tft.println("Smarowanie za:");
tft.setCursor(120, 130);
tft.print(godziny);
tft.println(" h");
tft.setCursor(60, 180);
tft.println("Lozysko RT 45");
}
void ekranBrakSmarowania() {
tft.fillScreen(ILI9341_RED);
tft.setTextColor(ILI9341_BLACK);
tft.setTextSize(4);
tft.setCursor(60, 30);
tft.println("SMES");
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(3);
tft.setCursor(70, 100);
tft.println("BRAK");
tft.setCursor(20, 140);
tft.println("SMAROWANIA");
tft.setCursor(60, 190);
tft.setTextSize(2);
tft.println("Lozysko RT 45");
}