migrate
This commit is contained in:
1 parent
f6da5b649f
commit
2a397db360
1 file changed
+4
@@ -61,6 +61,7 @@ class CharacteristicCallbacks: public BLECharacteristicCallbacks {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class MyServerCallbacks: public BLEServerCallbacks {
|
||||
void onConnect(BLEServer* pServer) {
|
||||
Serial.println("Conecction with client");
|
||||
@@ -109,6 +110,7 @@ void loop() {
|
||||
|
||||
updateClock();
|
||||
}
|
||||
|
||||
void initDevice(){
|
||||
BLEDevice::init(deviceName);
|
||||
BLEServer *pServer = BLEDevice::createServer();
|
||||
@@ -152,6 +154,7 @@ void initDevice(){
|
||||
BLEDevice::startAdvertising();
|
||||
Serial.println("Characteristic defined! Now you can read it in your phone!");
|
||||
}
|
||||
|
||||
void updateClock(){
|
||||
unsigned long curMil = millis();
|
||||
|
||||
@@ -164,6 +167,7 @@ void updateClock(){
|
||||
if (MIN >= 60) {MIN = 0; HOUR++; timeChanged = true;}
|
||||
if (HOUR >= 24) {HOUR = 0; DAY++; timeChanged = true;}
|
||||
}
|
||||
|
||||
void drawText(int width, int hight,int size, const char* text) {
|
||||
gfx->setCursor(width, hight);
|
||||
gfx->setTextSize(size);
|
||||
|
||||
Reference in new issue
Block a user