diff --git a/examples/EnergyResetAsync/EnergyResetAsync.ino b/examples/EnergyResetAsync/EnergyResetAsync.ino index 65994f8..069daeb 100644 --- a/examples/EnergyResetAsync/EnergyResetAsync.ino +++ b/examples/EnergyResetAsync/EnergyResetAsync.ino @@ -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()); serializeJson(doc, Serial); @@ -24,5 +27,4 @@ void loop() { if (jsy.getEnergy1() > 0 || jsy.getEnergy2() > 0 || jsy.getEnergyReturned1() > 0 || jsy.getEnergyReturned2() > 0) jsy.resetEnergy(); } - delay(1000); } diff --git a/platformio.ini b/platformio.ini index b570046..334d315 100644 --- a/platformio.ini +++ b/platformio.ini @@ -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 diff --git a/src/MycilaJSY.h b/src/MycilaJSY.h index 5f19df7..6d3aacd 100644 --- a/src/MycilaJSY.h +++ b/src/MycilaJSY.h @@ -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