#include "Free_Fonts.h"
#include <TFT_eSPI.h>
#include <SPI.h> // this is needed for display
// The display also uses hardware SPI, plus #9 & #10
#define TFT_CS 15
#define TFT_DC 2
#define TFT_MOSI 23
#define TFT_SCLK 18
float dispTemp = 22.3;
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library with default width and height
void setup(void) {
tft.begin();
tft.setRotation(3);
bojler(7,130);
grzejnik(10,40);
tft.fillRect(52,81,5,3,TFT_BLUE);
tft.fillRect(57,81,3,130,TFT_BLUE);
tft.fillRect(52,209,8,3,TFT_BLUE);
}
void loop() {
}
void bojler(int x, int y){
tft.fillRoundRect(x,y,45,100,6,TFT_WHITE);
tft.fillRoundRect(x+2,y+2,45-4,100-4,4,TFT_DARKGREY);
tft.fillRect(x,y+100,10,3,TFT_WHITE);
tft.fillRect(x+35,y+100,10,3,TFT_WHITE);
tft.drawLine(x+39,y+20,x+44,y+20, TFT_WHITE);
tft.drawLine(x+39,y+20,x+7,y+30, TFT_WHITE);
tft.drawLine(x+39,y+40,x+7,y+30, TFT_WHITE);
tft.drawLine(x+39,y+40,x+7,y+50, TFT_WHITE);
tft.drawLine(x+39,y+60,x+7,y+50, TFT_WHITE);
tft.drawLine(x+39,y+60,x+7,y+70, TFT_WHITE);
tft.drawLine(x+39,y+80,x+7,y+70, TFT_WHITE);
tft.drawLine(x+39,y+80,x+44,y+80, TFT_WHITE);
}
void grzejnik(int x, int y){
tft.fillRect(x,y+4,42,3,TFT_WHITE);
tft.fillRect(x,y+41,42,3,TFT_WHITE);
tft.fillRoundRect(x+2,y,8,48,3,TFT_WHITE);
tft.fillRoundRect(x+3,y+1,6,46,3,TFT_LIGHTGREY);
tft.fillRoundRect(x+2+10,y,8,48,3,TFT_WHITE);
tft.fillRoundRect(x+3+10,y+1,6,46,3,TFT_LIGHTGREY);
tft.fillRoundRect(x+2+20,y,8,48,3,TFT_WHITE);
tft.fillRoundRect(x+3+20,y+1,6,46,3,TFT_LIGHTGREY);
tft.fillRoundRect(x+2+30,y,8,48,3,TFT_WHITE);
tft.fillRoundRect(x+3+30,y+1,6,46,3,TFT_LIGHTGREY);
}
void themeClockTFT(float value, const String& lable, const String& units, const String& valueSample, const String& valueType, unsigned int accuracy) {
int xpos = 10;
int ypos = 45;
int yPad = 0;
int padding = tft.textWidth(String(value, accuracy), FONT8);
tft.setTextDatum(TL_DATUM);
tft.drawString(lable, xpos, ypos, FONT4);
tft.setTextDatum(TR_DATUM);
tft.drawString(units, 240 - xpos, ypos, FONT4);
tft.setTextDatum(TL_DATUM);
tft.setTextPadding(padding);
ypos += tft.fontHeight(FONT8) / 2 + yPad;
tft.drawFloat(value, accuracy, (240 - padding) / 2, ypos, FONT8);
tft.setTextPadding(0);
}
Loading
ili9341-cap-touch
ili9341-cap-touch