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

    paper s3 micropython example for Power.lightSleep()

    PRODUCTS
    2
    5
    69
    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.
    • J
      jhfoo2
      last edited by

      Tried using uiflow to do lightsleep but it just hangs and needs a power restart. Does anyone have a working sample?

      felmueF 1 Reply Last reply Reply Quote 0
      • felmueF
        felmue @jhfoo2
        last edited by felmue

        Hello @jhfoo2

        please have a look at the UIFlow2 Project Zone example I created: M5PaperS3_Light_Sleep_Test_UIFlow2.4.3

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        J 1 Reply Last reply Reply Quote 0
        • J
          jhfoo2 @felmue
          last edited by

          @felmue said in paper s3 micropython example for Power.lightSleep():

          M5PaperS3_Light_Sleep_Test_UIFlow2.4.3

          Thanks! I see that was able to sleep and loop, and I can add simple code to detect where it was touched that woke it up.

          Can you help me understand why you put in the 1sec time.sleep()?

          1 Reply Last reply Reply Quote 0
          • J
            jhfoo2
            last edited by jhfoo2

            Also: I try to skip uiflow and code directly in micropython. Do you know why I can't get touched X,Y in this code:

                while True:
                  StatusLabel.setText('SLEEP')
                  time.sleep(1)
                  print ('sleep')
                  Power.lightSleep(10 * 1000000, True)
                  StatusLabel.setText('WAKE')
                  time.sleep(1)
                  print ('wake')
                  time.sleep(1)
                  M5.update()
                  time.sleep(1)
                  (TouchX, TouchY, _, _) = M5.Touch.getTouchPointRaw()
                  print (f'{TouchX}, {TouchY}')
            
            
            felmueF 1 Reply Last reply Reply Quote 0
            • felmueF
              felmue @jhfoo2
              last edited by

              Hi @jhfoo2

              well, in my case, without the 1 second delay the UI label wasn't fully updated on the display. Or in other words, ESP32 already went into light sleep while in the background the display was still finishing to update. (In your case it might be ok without the delay as the print() takes some time.)

              I think the reason for not getting the touched X, Y is that internally the wake-up code already read the touch IC registers and by doing so cleared the values. But I could be wrong about that as it is simply a guess.

              Thanks
              Felix

              GPIO translation table M5Stack / M5Core2
              Information about various M5Stack products.
              Code examples

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