#include<SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
int speed = 0;
void setup() {
pinMode(2, INPUT_PULLUP);
tft.begin();
}
void loop() {
if(speed <120)
{
speed++;
}
if(speed == 120)
{
speed =0;
}
// Ekran pierwszy
//belka
tft.fillRect(0,55,240,5,ILI9341_RED);
// dane 1 sektora
int coldEngine = 0;
int SERW = 0 ;
if(coldEngine || SERW == 1)
{
//Cold Engine Icon
tft.drawRect(2,2,40,40,ILI9341_ORANGE);
//Service Warning
tft.setTextColor(ILI9341_ORANGE);
tft.setTextSize(3);
tft.setCursor(70, 15);
tft.print("SERW");
}
else
{
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(3);
tft.setCursor(1, 15);
tft.print("EcoDrive");
}
//Gear
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(3);
tft.setCursor(160,15);
tft.print("1->2"); //strzałka ?
// sektor 2
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(3);
tft.setCursor(45,70);
tft.print("Predkosc");
tft.setTextSize(8);
tft.setCursor(50,120);;
tft.print("100");
tft.setTextSize(3);
tft.setCursor(83,200);
tft.print("Km/h");
// put your main code here, to run repeatedly:
}