Skip to content

Commit

Permalink
cleansed void loop
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaclawik committed Feb 27, 2022
1 parent b8ea1d9 commit 3ea08f8
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions main/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,19 @@ BLYNK_WRITE(V8) {
}


BLYNK_CONNECTED() {
if (startup) {
// check relay status
Blynk.syncVirtual(V1);
// checks signal quality
Blynk.syncVirtual(V8);
startup = false;
// sends push notification that device has rebooted
Blynk.logEvent("startup","The device has been rebooted");
}
}


/*
* updates the device uptime in hours, and
* then pushes the uptime to virtual pin V5
Expand Down Expand Up @@ -227,13 +240,4 @@ void setup() {
*/
void loop() {
Blynk.run();
if (startup) {
// check relay status
Blynk.syncVirtual(V1);
// checks signal quality
Blynk.syncVirtual(V8);
startup = false;
// sends push notification that device has rebooted
Blynk.logEvent("startup","The device has been rebooted");
}
}

0 comments on commit 3ea08f8

Please sign in to comment.