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

    Turn Off Display

    Scheduled Pinned Locked Moved FAQS
    10 Posts 5 Posters 42.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.
    • P Offline
      Pelocks
      last edited by

      Hello,

      Is it posible to turn off the display and wake it up by pressing a button?

      Thanks

      JJJ 1 Reply Last reply Reply Quote 0
      • suremicroS Offline
        suremicro
        last edited by

        Hi

        Funny I looked at this last night - if you set the brightness down to 0 it seems to turn the display off (I still need to measure the current usage).

        I added a timer in the loop so that the screen 'turned off' after a few seconds and would switch back on when the first button pressed - very simple but just a test.

        1 Reply Last reply Reply Quote 0
        • JJJ Offline
          JJ @Pelocks
          last edited by

          @pelocks @zazar
          Hi, you can use these two functions:

          M5.setWakeupButton(BUTTON_B_PIN);
          M5.powerOFF();
          

          ...as demonstrated in Tom Such's menu system which is discussed in the link below:
          http://forum.m5stack.com/topic/78/m5stack-simple-applications-menu-some-apps

          If you open the code in Arduino, those functions are used on the "system" tab not the main tab that it opens to. You have to select it.

          There is also a handy list of functions here: https://github.com/Kongduino/M5CheatSheet

          D 1 Reply Last reply Reply Quote 2
          • P Offline
            Pelocks
            last edited by

            Hi,

            Thanks for the responces, it really help extending battery charge

            1 Reply Last reply Reply Quote 0
            • D Offline
              dda @JJ
              last edited by

              @jimit That puts the whole machine to sleep. If you want to turn only the LCD off/on, you can do M5.Lcd.setBrightness(brightness); where brightness is 100 for on and 0 for off.

              D 1 Reply Last reply Reply Quote 1
              • D Offline
                dda @dda
                last edited by

                @dda Actually this seems to work better:

                  M5.Lcd.writecommand(ILI9341_DISPOFF);
                  M5.Lcd.setBrightness(0);
                

                1ILI9341_DISPOFF` doesn't turn off the backlight, just the screen itself. So by doing both, you should be saving more.

                1 Reply Last reply Reply Quote 1
                • world101W Offline
                  world101
                  last edited by

                  If you have the m5stack with MPU-9250... it would be cool if you code the display to turn off after a certain time, then turn it back on once you pick up or move the m5stack. Anyone want to implement that?

                  D 1 Reply Last reply Reply Quote 1
                  • D Offline
                    dda @world101
                    last edited by

                    @world101 I'll do that as soon as I buy another M5, with the MPU9250.

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      Pelocks
                      last edited by

                      Hi,

                      I use brightness setup to 0 and have improved battery life.

                      Then i use wakeup button and finally deepsleep, getting almost 3 days of battery life.

                      But deepsleep with time wakeup only let my setup 30seconds max, because of IP5306 automatic standby (whern load current drops below 45mA during 32 seconds)

                      Any ideas to avoid automatic standby?

                      Thanks!!!

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        Pelocks
                        last edited by

                        Hi,

                        Found this example:
                        https://gist.github.com/igrr/54f7fbe0513ac14e1aea3fd7fbecfeab
                        It uses RTC memories and wake stub to decides whether to continue booting the firmware, or to go back to sleep.

                        Maybe we could develop a code to run 10 times x 30seconds deepsleep = 300seconds deepsleep (5min)

                        1 Reply Last reply Reply Quote 1

                        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