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