Xinyuan-LilyGO / LilyGo-EPD47

GNU General Public License v3.0
379 stars 119 forks source link

Deep-sleep and button #41

Closed guyou closed 1 year ago

guyou commented 3 years ago

Is it possible to add documentation or example about having a button awaken the device from deep sleep mode?

My idea: having the device displaying an information refreshed only once an hour (or two). So, it is mostly in deep-sleep mode. When I click a button, the device awakes, changes its display mode (other information) and refresh.

cgreening commented 2 years ago

If you just want to use one button then this is pretty easy with EXT0 or EXT1 sleep modes. If you want to be able to detect multiple buttons then you'll need to use the ULP.

The issue with detecting multiple buttons is that they are active LOW. This makes it impossible to use EXT1 mode to monitor multiple buttons and know which button is pushed.

cgreening commented 2 years ago

I've pulled together some code for this here: https://github.com/atomic14/esp32-ulp