Skip to main content
. 2023 Oct 19;23(20):8585. doi: 10.3390/s23208585
Key Code:
void publishDate() {
StaticJsonDocument < 128 > doc;
doc[“0”] = 1981.09;//415
doc[“1”] = 1054.5;//445
doc[“2”] = 1098.69;//480
doc[“3”] = 703.11;//515
doc[“4”] = 607.74;//555
doc[“5”] = 1660.49;//590
doc[“6”] = 4100.58;//630
doc[“7”] = 5216.3;//680
doc[“8”] = 5731;//750
doc[“9”] = 2511.73;//900
char buffer [128];
serializeJson(doc, buffer);
client.publish(“/xjnydx/Spectral”, buffer);
}