Turn Off Display
Is it posible to turn off the display and wake it up by pressing a button?
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.
...as demonstrated in Tom Such's menu system which is discussed in the link below:
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
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:
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.
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?
Found this example:
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)