diff --git a/inos/Smart-Watch/Smart-Watch.ino b/inos/Smart-Watch/Smart-Watch.ino index 09619d6..9e2bdc3 100644 --- a/inos/Smart-Watch/Smart-Watch.ino +++ b/inos/Smart-Watch/Smart-Watch.ino @@ -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);