You can watch a video explanation of this code here
This repo contains two demo project:
Shows you how to read GPIOs pins with the Ultra Low Power coprocessor. This is handy if you have a board with buttons that are active low preventing you from using the EXT1 sleep mode.
This shows you how to write to GPIO pins - it's a blink sketch that runs on the ULP!