Describe the issue
As the title, Here is my JSON
{
"sensor": {
"CH1": {
"status": "sucess",
"waterLevel": "0.37m"
},
"CH2": {
"status": "sucess",
"waterLevel": "0.57m"
}
}
}
And here is my code
StaticJsonDocument<192> doc;
JsonObject sensor = doc.createNestedObject("sensor");
JsonObject sensor_CH1 = sensor.createNestedObject("CH1");
sensor_CH1["status"] = "sucess";
sensor_CH1["waterLevel"] = "0.37m";
JsonObject sensor_CH2 = sensor.createNestedObject("CH2");
sensor_CH2["status"] = "sucess";
sensor_CH2["waterLevel"] = "0.57m";
serializeJson(doc, output);
But want to define a char array like
const char *arrary = "{\"status\":\"success\", \"waterLevel\":\"0.37m\"}"
and
sensor[CH1] = array;
but there always has " " and " , how can I do?
the picture’s two way are failed.