#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define BLACK 0x000
#define GREY 0x7BEF
#define GREEN 0x05E0
#define YELLOW 0xFFE0
#define RED 0xF800
#define BLUE 0x07FF
#define CYAN 0x07FF
#define WHITE 0xFFFF
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
void setup() {
Serial.begin(9600);
tft.begin();
tft.setRotation(3);
drawFirstBackground();
drawFirstScreen();
}
void loop(void) {
}
void drawFirstBackground()
{
tft.drawRect(180,0, 320, 120, RED);
tft.drawRect(181,1, 320, 119,RED);
tft.drawLine(180,120, 180, 180, RED);
tft.drawLine(181,120, 181, 180, RED);
tft.drawRect(101,181, 320, 239, RED);
tft.drawRect(100,180, 320, 240, RED);
}
void drawFirstScreen()
{
char strVal[6];
tft.setTextColor(GREEN);
tft.setTextSize(1);
tft.setCursor(250,10);
tft.print("Fve");
tft.setCursor(270,190);
tft.print("Tlak");
tft.setCursor(190,190);
tft.print("Vitr");
tft.setCursor(120,190);
tft.print("Dest");
tft.setCursor(188,108);
tft.print(1 ? "N" : "D");
dtostrf(3, 2, 0, strVal);
char res[7];
strcpy(res, strVal);
dtostrf(22, 2, 0, strVal);
strcat(res,":");
strcat(res, strVal);
tft.setCursor(198,108);
tft.print(res);
tft.setCursor(220,125);
tft.print( 1 ? "M" : 2 ? "H" : "A");
if( 1) {
tft.setTextSize(2);
dtostrf(18.5, 2, 0, strVal);
tft.setCursor(260,150);
tft.print(strVal);
tft.drawRect(250, 140, 60, 30, WHITE);
}
tft.drawRoundRect(190, 140, 40, 40, 5, GREEN);
tft.setTextColor(WHITE);
tft.setTextSize(4);
dtostrf(32, 4, 1, strVal);
tft.setCursor(40,100);
tft.print(" ");
tft.setCursor(40,100);
tft.print("1234");
tft.setTextSize(3);
dtostrf(2400 , 4, 0, strVal);
tft.setCursor(220,35);
tft.print(strVal);
dtostrf(800, 4, 0, strVal);
tft.setCursor(220,80);
tft.print(strVal);
tft.setTextSize(2);
//tlak
dtostrf(1050, 4, 0, strVal);
tft.setCursor(260,210);
tft.print(strVal);
//vitr
dtostrf(20.5, 2, 1, strVal);
tft.setCursor(170,210);
tft.print(strVal);
//dest
dtostrf(40.8, 3, 1, strVal);
tft.setCursor(110,210);
tft.print(strVal);
dtostrf(50, 2, 0, strVal);
tft.setTextSize(2);
tft.setCursor(198,150);
tft.print(strVal);
dtostrf(19.6, 2, 1, strVal);
tft.setCursor(130,5);
tft.print(strVal);
}