We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function MakehttpRequest
if (httpCode == 200) // Checking the returning code { String payload = http.getString(); // Getting the request response payload StaticJsonDocument<1024> doc; // Parse JSON object DeserializationError error = deserializeJson(doc, payload); if (error) { return; } else { JsonObject main = doc["main"]; temp = (float)main["temp"]-273.15; // Get temperature in °C humidity = (uint_fast8_t)main["humidity"]; // Get humidity in % pressure = (uint_fast8_t)main["pressure"]; // Get pressure in bar visibility = (float)doc["visibility"]; // Get visibility in m weatherCity = (const char*)doc["name"]; JsonObject wind = doc["wind"]; wind_speed = (float)wind["speed"]; // Get wind speed in m/s wind_degree = (float)wind["deg"]; // Get wind degree in ° JsonObject weather = doc["weather"][0]; weatherDesc = (const char*)weather["description"]; weatherIcon = (const char*)weather["icon"]; JsonObject sys = doc["sys"]; sunrise = (time_t)sys["sunrise"]; sunset = (time_t)sys["sunset"]; weatherCountry = (const char*)sys["country"]; }
The text was updated successfully, but these errors were encountered:
Forgiveness. Right now I can't check anything. I had a traffic accident
Sorry, something went wrong.
No branches or pull requests
Function MakehttpRequest
The text was updated successfully, but these errors were encountered: