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.
2 out of 2
Suggested Topics
-
Day 1 - Status report
Announcements • 23 Mar 2014, 22:45 • hek 24 Mar 2014, 20:12 -
JSN-SR04T-V3.0 Coax cable extended
Troubleshooting • 12 days ago • bocalexandru 11 days ago -
Ghost Child
Troubleshooting • 17 days ago • FcNanoLed 13 days ago -
JSN SR04T - Temperature Influencing Readings
Troubleshooting • 6 Sept 2019, 07:51 • Timbergetter 3 days ago -
Getting system time from the controller
Troubleshooting • 27 Feb 2025, 01:39 • dpcons 29 days ago -
Can not compile MySensors on esp8266
Troubleshooting • 24 Aug 2024, 15:35 • TheoL 29 Aug 2024, 20:47