Files
ThatProject/FIREBASE/Cloud_Firestore_Application/0_ESP32TTGO_DHT11/Display.cpp

29 lines
658 B
C++

#include "Display.h"
Display::Display() {
tft = new TFT_eSPI();
}
Display::~Display() {
delete tft;
}
void Display::initTFT() {
tft->init();
tft->fillScreen(TFT_BLACK);
tft->setRotation(1);
tft->setTextColor(TFT_WHITE, TFT_BLACK);
tft->setTextDatum(MC_DATUM);
tft->setFreeFont(&Orbitron_Light_24);
}
void Display::centerMsg(String text) {
tft->drawString(text, tft->width() / 2, 60);
}
void Display::tempUpdates(String temp, String hum, String status) {
tft->setTextPadding(tft->width());
tft->drawString(temp, tft->width() / 2, 40);
tft->drawString(hum, tft->width() / 2, 70);
tft->drawString(status, tft->width() / 2, 110);
}