message show on screen

This commit is contained in:
lash404 committed 2026-11-02 08:48:07 +01:00
1 parent 6d69eb0863
commit be742caa46
1 file changed
+9 -1
+9 -1
View File
@@ -6,6 +6,8 @@
#include <BLEUtils.h>
#include <BLEServer.h>
#include <string.h>
#define TFT_DC D7
#define TFT_RST D9
@@ -15,7 +17,9 @@ unsigned long HOUR=0;
unsigned long DAY=0;
unsigned long MONTH=0;
unsigned long YEAR=2026;
unsigned long YEAR=20;
String message = "";
unsigned long preMil = 0;
const long interval = 1000;
@@ -57,6 +61,7 @@ class CharacteristicCallbacks: public BLECharacteristicCallbacks {
}
if (pCharacteristic->getUUID().equals(BLEUUID(CHAR_MESSAGE_UUID))) {
Serial.print("Message Recived: ");
message = value;
Serial.println(value);
}
}
@@ -104,6 +109,9 @@ void loop() {
gfx->setCursor(20, 80);
gfx->printf("Date: %02d.%02d.%04d\n", DAY, MONTH, YEAR);
gfx->setCursor(20, 110);
gfx->printf("message: %s", message);
timeChanged = false;
}