Post topics, source code that relate to the Arduino Platform

User avatar
By LauBaz
#24908 Is there any way to use the deepsleep for longer than 35 minutes? (That is the maximum time in microseconds for an int I believe)
User avatar
By Stoney
#24941
LauBaz wrote:Is there any way to use the deepsleep for longer than 35 minutes? (That is the maximum time in microseconds for an int I believe)


not tried this long but 2^32 / 1000000 = 4295 seconds or 1 hour 11 minutes.
should be doable ?
apart fron that if you want to wake using external pulse you can use 0.
then it will never wake.
User avatar
By LauBaz
#24999
Stoney wrote:
not tried this long but 2^32 / 1000000 = 4295 seconds or 1 hour 11 minutes.
should be doable ?


Thank you for that answer. After checking a bit, I am puzzled:

ESP.deepSleep(60*60*1000000); //Compiler error: "warning: integer overflow in expression [-Woverflow]"
ESP.deepSleep(3600000000); //no error, this seems to work (although I have not waited an hour to wait for it). I have even tried it all the way to 4294967295 (2^32 -1) and it compiles fine.

What am I missing there?