You can watch a video walkthrough of this code here
You will probably want to change this line:
#define BUTTON_GPIO GPIO_NUM_35
To match one of the buttons on your board.
Make sure this is uncommented:
#define DEEP_SLEEP_TIMER
When you push the button, the ESP32 will enter deep sleep for 30 seconds.
Make sure this is uncommented:
#define DEEP_SLEEP_EXT0
The ESP32 will wake up when the button is pressed.
There are two options here:
#define DEEP_SLEEP_EXT1_ANY_HIGH
This will wake the ESP32 if either pins 12 or 15 go high.
Or:
#define DEEP_SLEEP_EXT1_ALL_LOW
This will wake the ESP32 when both pins 12 and 15 are taken low.
Uncomment:
#define DEEP_SLEEP_TOUCH
The device will wake up when touch pin 9 is touched (GPIO 32). You can just connect a wire to pin 32 and when you touch the wire the device will wake up.