Closed MHz000 closed 3 years ago
Thank you for fast replay Benoit! You're absolutely right😊 Sorry for my delayed answer. There was an internet access blackout. Curious in this situation I get an "Error compiling source". I love arduino IDE🤔
All the best MHz000
Am Mo., 8. Juni 2020 um 09:19 Uhr schrieb Benoît Blanchon < notifications@github.com>:
Hi @MHz000 https://github.com/MHz000
Please try:
int id = obj["weather"][0]["id"]; String situation = obj["weather"][0]["main"];
The result could still be null if deserializeJson() https://arduinojson.org/v6/api/json/deserializejson/ fails.
See also:
- Deserialization tutorial https://arduinojson.org/v6/doc/deserialization/
- OpenWeatherMap case study in Mastering ArduinoJson https://arduinojson.org/book/
Best regards, Benoit
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arduino-libraries/Arduino_JSON/issues/8#issuecomment-640416341, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB42SGTTAI4B7N5KVDD5KRLRVSGJ3ANCNFSM4NYBJYYQ .
i got the same error and can't see reply of Benoit, how can you solve this
I'm struggeling parsing a JASON-object received by OpenWeatherMap like this one:
Access induvidual values I use code like this:
However the weather element:
is encapsulated in additional
[...]
How can I access values for "id", "main", etc? in arduino/c++ idiom?Trying:
compiles fine but give "0" or "null" as result
Thanl you for any advice