write json directly into Serial
This commit is contained in:
parent
ac8dd2c807
commit
d232bc4ffa
@ -33,8 +33,8 @@ void setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
StaticJsonDocument<200> jsonDoc;
|
|
||||||
readCommand();
|
readCommand();
|
||||||
|
StaticJsonDocument<200> jsonDoc;
|
||||||
readRcSwitch(jsonDoc);
|
readRcSwitch(jsonDoc);
|
||||||
Dht::read(jsonDoc);
|
Dht::read(jsonDoc);
|
||||||
if (!jsonDoc.isNull()) {
|
if (!jsonDoc.isNull()) {
|
||||||
@ -116,13 +116,10 @@ void runRcSwitchCommand(JsonVariant jsonDoc) {
|
|||||||
} else {
|
} else {
|
||||||
mySwitch.setProtocol(protocol);
|
mySwitch.setProtocol(protocol);
|
||||||
mySwitch.send(rcSwitch["value"]);
|
mySwitch.send(rcSwitch["value"]);
|
||||||
// Serial.println((const char*)rcSwitch["value"]);
|
|
||||||
}
|
}
|
||||||
char output[256];
|
serializeJson(jsonDoc, Serial);
|
||||||
serializeJson(jsonDoc, output);
|
Serial.println();
|
||||||
Serial.println(output);
|
|
||||||
// blink();
|
// blink();
|
||||||
// delay(1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void runJsonCommands(String cmd) {
|
void runJsonCommands(String cmd) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user