import ugfx, badge
from time import sleep

ugfx.init()
ugfx.LUT_FULL
ugfx.input_init()
ugfx.clear(ugfx.BLACK)
ugfx.flush()
ugfx.clear(ugfx.WHITE)
ugfx.flush()

def go_home(pushed):
    if(pushed):
        import machine
        machine.deepsleep(1)

ugfx.input_attach(ugfx.BTN_B, go_home)
while True:
    badge.eink_png(0,0,'/lib/spaghetticode/1.png')
    ugfx.flush() 
    sleep(1.5)
    badge.eink_png(0,0,'/lib/spaghetticode/2.png')
    ugfx.flush() 
    sleep(1.5)
    ugfx.clear(ugfx.BLACK)
    ugfx.flush()
