gw.sleep(...) and milis()
-
When using
gw.sleep( INTERRUPT, CHANGE, SLEEP_TIME );
I noticed that the millis() are not updated until the board wakes up again.
Is that how it is supposed to be?
If so, is there an alternative?
Based on the millis() before and after the sleep I want to execute different methods...
Due to the fact that I use the interrupt I obviously don't know how much time lies between the two.
-
Yes, it is a fact we have to live with. You can look at the return-value if wake-up was triggered by external interrupt or timer.
If timer triggered wake-up you know how long the sensor has slept. But if wakeup was triggered by external interrupt there is no way to know how long it slept.
1 out of 2
Suggested Topics
-
Day 1 - Status report
Announcements • 23 Mar 2014, 22:45 • hek 24 Mar 2014, 20:12 -
Ghost Child
Troubleshooting • 15 days ago • FcNanoLed 11 days ago -
Raspberry Pi 5: invalid GPIO 9
Troubleshooting • 27 Aug 2024, 13:20 • igo 27 Aug 2024, 13:20 -
Getting system time from the controller
Troubleshooting • 27 Feb 2025, 01:39 • dpcons 27 days ago -
Can not compile MySensors on esp8266
Troubleshooting • 24 Aug 2024, 15:35 • TheoL 29 Aug 2024, 20:47 -
Compiling Sensor code using BME280 and ESP8266
Troubleshooting • 26 Feb 2025, 00:32 • dpcons 26 Feb 2025, 06:22