This gist was automatically pasted at the request of the code author or one of the discord server helpers. If you have any suggestions or bugs to report, you can do so on our GitHub repository, or in our discord server. This project is run by volunteers so feel free to fork and commit your changes then open a pull request!
Created
January 15, 2021 22:11
-
-
Save ArduinoDiscordBot/a1933f1edba3f13c6000b9b27bfa626d to your computer and use it in GitHub Desktop.
Code by timotejj#8782 - Fri Jan 15 2021 22:11:11 GMT+0000 (Coordinated Universal Time)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Parse JSON object | |
JsonObject& root = jsonBuffer.parseObject(payload); | |
if (!root.success()) { | |
Serial.println(F("Parsing failed!")); | |
return; | |
} | |
// Decode JSON/Extract values | |
Serial.println(F("Response:")); | |
Serial.println(root["Miestnost"].as<char*>()); | |
Serial.println(root["Status"].as<char*>()); | |
} | |
else | |
{ | |
Serial.println("Error in response"); | |
} | |
http.end(); //Close connection | |
delay(5000); //GET Data at every 5 seconds | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment