Closed gsdevme closed 3 years ago
When the MKR1010 goes to sleep, it will lose the Serial connection. This is expected behavior. In your sketch, when the device wakes up after LowPower.sleep(5000); // sleep for 5 seconds
, the code will return to the top of loop()
where you have it waiting for the serial connection while (!Serial);
. Since the Serial connection was cut off at sleep
, your code will hang here.
Try putting your while (!Serial);
in setup()
and instead of loop()
printing to the Serial Monitor, have it toggle an LED each loop.
Interesting, I think I maybe adapted this from an ESP32 which perhaps keeps the serial connection open or at least implicitly reconnects in the background. I can confirm a blink is working as expected. Will mark as resolved thanks for that @MattStarfield
Hi,
Trying to use this library on the Arduino MKR WiFi 1010 seems to ignore the sleep and/or just goes into a frozen state and never wakes up