From: Eugene Crosser Date: Thu, 18 Jul 2024 22:22:51 +0000 (+0200) Subject: Add rudimentary display X-Git-Url: http://average.org/gitweb/?a=commitdiff_plain;h=481e039836946eebccd57677e9fbf11bee12e41a;p=ThermoBeaconDisplay.git Add rudimentary display --- diff --git a/ThermoBeaconDisplay.ino b/ThermoBeaconDisplay.ino index 72fd685..ef9ee2b 100644 --- a/ThermoBeaconDisplay.ino +++ b/ThermoBeaconDisplay.ino @@ -3,6 +3,22 @@ */ #include +#include +#include + +TFT_eSPI tft = TFT_eSPI(); + +void displayT(String addr, float batt, float temp, float humid, int ticks, int rssi) { + tft.fillScreen(TFT_BLACK); + tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN); + tft.setCursor(0, 4, 4); + tft.setTextColor(TFT_GREEN); + tft.println(addr.substring(6)); + tft.println(temp); + tft.println(humid); + tft.println(rssi); + tft.println(batt); +} void dbg(BLEDevice peripheral) { Serial.print("Address: "); @@ -58,6 +74,7 @@ void advHandler(BLEDevice dev) { Serial.print(" Rssi: "); Serial.print(dev.rssi()); Serial.println(); + displayT(dev.address(), b, t, h, tm, dev.rssi()); } } } @@ -72,6 +89,7 @@ void setup() { } BLE.setEventHandler(BLEDiscovered, advHandler); BLE.scan(true); + tft.init(); } void loop() {