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