Skip to content

Commit

Permalink
Reset sample update
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Feb 21, 2024
1 parent 044befe commit d5712d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions examples/EnergyResetAsync/EnergyResetAsync.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ void setup() {
continue;

// read JSY on pins 17 (JSY RX) and 16 (JSY TX)
jsy.begin(&Serial2, 17, 16, 60, true, 0);
jsy.begin(&Serial2, 17, 16, true);
}

void loop() {
delay(1000);

if (jsy.isEnabled()) {

JsonDocument doc;
jsy.toJson(doc.to<JsonObject>());
serializeJson(doc, Serial);
Expand All @@ -24,5 +27,4 @@ void loop() {
if (jsy.getEnergy1() > 0 || jsy.getEnergy2() > 0 || jsy.getEnergyReturned1() > 0 || jsy.getEnergyReturned2() > 0)
jsy.resetEnergy();
}
delay(1000);
}
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[platformio]
lib_dir = .
; src_dir = examples/EnergyReset
; src_dir = examples/EnergyResetAsync
src_dir = examples/EnergyResetAsync
; src_dir = examples/Read
src_dir = examples/ReadAsync
; src_dir = examples/ReadAsync
; src_dir = examples/SetSpeed
; src_dir = examples/SimpleEnergyReset
; src_dir = examples/SimpleSetSpeed
Expand Down
2 changes: 1 addition & 1 deletion src/MycilaJSY.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#endif

#ifndef MYCILA_JSY_ASYNC_STACK_SIZE
#define MYCILA_JSY_ASYNC_STACK_SIZE 256 * 6
#define MYCILA_JSY_ASYNC_STACK_SIZE 2048
#endif

#ifndef MYCILA_JSY_READ_TIMEOUT_MS
Expand Down

0 comments on commit d5712d8

Please sign in to comment.