In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of how esp8266 parses json data, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value, I believe you will have something to gain after reading this esp8266 article on how to parse json data, let's take a look.
# include void setup () {Serial.begin (115200); Serial.println ("here for testing the parsing of json data"); / / when defining DynamicJsonDocument objects, we need to define a size information + copy size const size_t capacity = JSON_OBJECT_SIZE (2) + 30; DynamicJsonDocument doc (capacity) / / the backslash of the json file to be parsed indicates that the coming quotation mark is not the String jsonstr = "{\" username\ ":\" admin\ ",\" pwd\ ": 123456}"; / / deserializes the data into the object deserializeJson (doc, jsonstr); / / gets the parsed data String nameStr = doc ["username"]. As (); int numberInt = doc ["pwd"]. As () / / output parsed data information through serial port monitor Serial.print ("usernameStr ="); Serial.println (nameStr); Serial.print ("pwdInt ="); Serial.println (numberInt);} void loop () {}
It is important to note that you need to install the library ArduinoJson first
Just install it in the Library Manager
Case effect
This is the end of the article on "how esp8266 parses json data". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how esp8266 interprets json data". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.