🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Resume program at position after sleep mode?

    Scheduled Pinned Locked Moved General
    2 Posts 1 Posters 4.6k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      Gero Nimo
      last edited by

      Hi,
      I have a rather big program that has quite a few functions. I would also like to save some battery and therefore I want to send my M5Stack into sleep mode.

      Program start;
      execute SETUP() once: function A(), function B(), C();

      LOOP(): function D(), function E(), START HERE SLEEP.

      When sleep is over, my program starts again at the beginning executing the SETUP() function. Is there any way to resume my program where it stopped? Like with the next line of code or with the next function? I do not want to start again at setup().

      LOOP(): function D(), function E(), START HERE SLEEP; Wake up from sleep; Resume with function F(), function G(). Start again with LOOP() function D(), E(), sleep,...

      1 Reply Last reply Reply Quote 0
      • G Offline
        Gero Nimo
        last edited by

        light sleep should do the job, but I have to do some testing.

        Are there any data or "connections" lost after you wake up from light sleep?

        1 Reply Last reply Reply Quote 0

        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
        • First post
          Last post