Hi
How do we code "sleep" to sleep indefinitely only to be awakened by a pin? I can't get it to sleep without a actual time associated...
Thanks
Zim
esp32 sleep indefinitely?
- Electroguard
- Posts: 921
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 302 times
- Been thanked: 339 times
Re: esp32 sleep indefinitely?
As a workaround, when periodically awakening it could read the 'wake-up' pin status and just go back to sleep if not activated (also offering opportunity for send low battery warnings if needed).
- cicciocb
- Site Admin
- Posts: 2160
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 461 times
- Been thanked: 1435 times
- Contact:
Re: esp32 sleep indefinitely?
You can simply use years as time .....[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat May 11, 2024 5:20 pm Hi
How do we code "sleep" to sleep indefinitely only to be awakened by a pin? I can't get it to sleep without a actual time associated...
Thanks
Zim
One year is 365*24*60*60 = 31536000 seconds
-
- Posts: 354
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 190 times
- Been thanked: 113 times
Re: esp32 sleep indefinitely?
I'd be tempted to go somewhere between Electroguard's and cicciocb's suggestion.
Perhaps once a week and as suggested, report battery condition.
Perhaps once a week and as suggested, report battery condition.