How to use deep sleep in a loop!!!
-
Hi all,
I have a LoPy4 with a pytrack.
I have a loop that essentially looks like this:init_timer = time.time() while True: final_timer = time.time() diff = final_timer - init_timer if diff > 300: do some stuff here init_timer = time.time() I'd like to incorporate this: machine.deepsleep(300*1000)into the code to make it deep sleep while it's waiting for those 5 minutes but it doesn't seem to be working.
Can anyone help with this? -
@Jacobcullen deep sleep will reset the board and it will start again at the top of boot.py and main.py. No need for a loop, but you need to find a way to save any variables / state as all python state will be reset.
-
This post is deleted!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login