Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Jan 27, 2024
1 parent 126d555 commit 5f3f340
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 6 additions & 7 deletions examples/JSYRead/JSYRead.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ void setup() {
}

void loop() {
Mycila::JSY.read();

JsonDocument doc;
Mycila::JSY.toJson(doc.to<JsonObject>());
serializeJson(doc, Serial);
Serial.println();

if (Mycila::JSY.read()) {
JsonDocument doc;
Mycila::JSY.toJson(doc.to<JsonObject>());
serializeJson(doc, Serial);
Serial.println();
}
delay(1000);
}
11 changes: 6 additions & 5 deletions examples/JSYReadAsync/JSYReadAsync.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ void setup() {
}

void loop() {
JsonDocument doc;
Mycila::JSY.toJson(doc.to<JsonObject>());
serializeJson(doc, Serial);
Serial.println();

if (Mycila::JSY.isEnabled()) {
JsonDocument doc;
Mycila::JSY.toJson(doc.to<JsonObject>());
serializeJson(doc, Serial);
Serial.println();
}
delay(5000);
}

0 comments on commit 5f3f340

Please sign in to comment.