Deserialize JSON Object in MQTT

Hello everyone! I did a deserialize on a JSON file which passes me 2 identical objects by running this for.

for (JsonObject elem :<JsonArray>()) {

  const char* Verso = elem["Ex1"]; // "IN", "IN"
  const char* Tipo = elem["Ex2"]; // "A", "A"
  int Numero = elem["Ex3"]; // 1, 50
  int ValoreIniziale = elem["Ex4"]; // 0, 0
  int Intervallo = elem["Ex5"]; // 3000, 3000
  const char* Modello = elem["Ex6"]; // "DHT22", "DHT22"

But how do I enter the individual fields to get the values out?

Hi, it will be easier to undersdand the issue if you share JSON data as well.

Take a look at docs to see how to read data from JSON array JsonArray | ArduinoJson 6

1 Like