def timelapse_main(): global pic_num global direc g.timelapse_state_activate() while g.TIMELAPSE_STATE == True: g.setup_interrupt(g.switches[2], timelapse_stop) filename = "image%04d.jpg" % pic_num pic_num = pic_num + 1 cam.snap(filename, direc) g.blink(g.leds[1], 0.05) time.sleep(2) g.remove_interrupt(g.switches[2]) time.sleep(1) g.remove_interrupt(g.switches[2]) g.setup_interrupt(g.switches[2], start_timelapse) g.boot_activate()
def timelapse_main(): global pic_num global direc g.timelapse_state_activate() while g.TIMELAPSE_STATE == True: g.setup_interrupt(g.switches[2], timelapse_stop) filename = "image%04d.jpg" % pic_num pic_num = pic_num+1 cam.snap(filename, direc) g.blink(g.leds[1], 0.05) time.sleep(2) g.remove_interrupt(g.switches[2]) time.sleep(1) g.remove_interrupt(g.switches[2]) g.setup_interrupt(g.switches[2], start_timelapse) g.boot_activate()
def setup(): g.setup() g.setup_interrupt(g.switches[2], stopanimation)
def setup(): g.setup() g.setup_interrupt(g.switches[2], start_timelapse) g.setup_interrupt(g.switches[3], stop)