Skip to content

Commit

Permalink
battery level
Browse files Browse the repository at this point in the history
  • Loading branch information
volca committed Aug 14, 2018
1 parent 2ae44c5 commit 2b622f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/04.Network/http-lock/http-lock.ino
Expand Up @@ -20,7 +20,8 @@ long unlockedTime = 0;

void handleQuery() {
char rsp[255];
sprintf(rsp, "{\"state\":\"%s\",\"statusCode\":200}", digitalRead(RELAY_PIN) ? "unlocked" : "locked");
sprintf(rsp, "{\"state\":\"%s\",\"statusCode\":200,\"battery\":100}", digitalRead(RELAY_PIN) ? "unlocked" : "locked");

server.send(200, "text/plain", rsp);
}

Expand Down

0 comments on commit 2b622f6

Please sign in to comment.