Here is my note.add request:
J *req1 = notecard.newRequest(“note.add”);
if (req1 != NULL)
{
JAddBoolToObject(req1, “sync”, true);
J *body = JAddObjectToObject(req1, “body”);
if (body != NULL)
{
JAddNumberToObject(body, “CardTime”, time);
JAddNumberToObject(body, “CardTemp”, cardTemp);
JAddNumberToObject(body, “voltage”, voltage);
JAddNumberToObject(body, “AT”, data.TemperatureC);
JAddNumberToObject(body, “AH”, data.Humidity);
JAddNumberToObject(body, “probeTip”, probeTemps[0]);
JAddNumberToObject(body, “probe30cm”, probeTemps[2]);
JAddNumberToObject(body, “probe60cm”, probeTemps[3]);
JAddNumberToObject(body, “probe90cm”, probeTemps[5]);
JAddNumberToObject(body, “probe120cm”, probeTemps[4]);
JAddNumberToObject(body, “probe150cm”, probeTemps[1]);
}
notecard.sendRequest(req1);
}
The values for the probe temps are mangled, they should all be around 23 degrees but the output looks like this:
{“req”:“note.add”,“sync”:true,“body”:{“CardTime”:1708580403,“CardTemp”:24.4375,“voltage”:3.538048032501625,“AT”:23.886474609375,“AH”:50.33951187133789,“probeTip”:23.886474609375,“probe30cm”:74.99565124511719,“probe60cm”:0,“probe90cm”:0,“probe120cm”:0,“probe150cm”:50.33951187133789},“crc”:“0032:1DAA93BA”}