Turn Off Display
-
Hello,
Is it posible to turn off the display and wake it up by pressing a button?
Thanks
-
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.
-
@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-appsIf 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
-
Hi,
Thanks for the responces, it really help extending battery charge
-
@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. -
@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.
-
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?
-
@world101 I'll do that as soon as I buy another M5, with the MPU9250.
-
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!!!
-
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)