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

    UIFlow Timer locks code?

    UIFlow
    1
    2
    1.4k
    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.
    • Z
      zoner
      last edited by

      I was trying to create a timer, which envokes power saving features after x amount seconds of non use/button press of the device.
      When in this 'powersave' mode, any button will wake up the device (M5StickCplus2) again (which works).
      some snippets of code below:

      Define timer:
      0_1708506301302_uiflow_block_1708506217114.png

      Timer Callback:
      0_1708506337551_uiflow_block_1708506226713.png

      Button Press:
      0_1708506407143_uiflow_block_1708506221134.png

      Somehow the timer locks all the processes and no action can be undertaken after the screen becomes visible again.
      Any hints (or previous experience) people have with this kind of power saving methods, or is there an easier way (using UIFlow).
      NOTE: UIFLow2 doesnt really work for my use case, so I gave up on that one.

      Z 1 Reply Last reply Reply Quote 0
      • Z
        zoner @zoner
        last edited by

        I think I cracked it. I hope this will help some people with the same issue.

        0_1708581715011_uiflow_block_1708581446233.png

        @ajb2k3 , I was looking at some of the comments regarding m5.lightsleep() and m5.deepsleep(). how can you wake the device up without a timer, is there a button press option?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post