#include <ArduinoJson.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
float t = 22.2;
float h = 55.5;
// char out[50];
// sprintf(out, "{\"temperature\":%.1f,\"humidity\":%.1f}", t, h);
JsonDocument doc;
doc["temperature"] = serialized(String(t,1));
doc["humidity"] = serialized(String(h,1));
char saida[sizeof(doc)];
serializeJson(doc, saida);
Serial.println(saida);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}