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:

    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?

  • Banned

    This post is deleted!

  • @Jacobcullen deep sleep will reset the board and it will start again at the top of and No need for a loop, but you need to find a way to save any variables / state as all python state will be reset.

Log in to reply

Pycom on Twitter