-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Hi,
i tried your code today and its working very well but cJSON is not converting a float number correctly.
You hit the problem if you try to read the dht22. The output looks like this:
{
"temp": %.0f,
"hum": %.0f
}
My current fix is to typecast the values like this:
cJSON_AddNumberToObject(root,"temp",(int8_t)data.dht22.temp);
cJSON_AddNumberToObject(root,"hum",(uint8_t)data.dht22.hum);
Maybe someone know how to fix the cJSON lib easily?!
I am using the esp-open-sdk (espressif lib v1.0.1) to compile the code.
Metadata
Metadata
Assignees
Labels
No labels