Exemple #1
0
def take_picture():
    print "Taking a picture"
    on_all()
    interface.show_image("instructions.png")
    for led in leds:
        time.sleep(1)
        off(led)
    time.sleep(0.5)
    on_all()
    # Take the picture
    snap()
    off_all()
    time.sleep(5)
    reset()
Exemple #2
0
def snap():
    camera = picamera.PiCamera()
    resolution = (interface.display_info.current_w, interface.display_info.current_h)
    resolution = (1920, 1080)
    camera.resolution = resolution
    camera.start_preview()
    time.sleep(1)
    now = time.strftime("%Y-%m-%d-%H:%M:%S")
    try:
        GPIO.output(leds[0], GPIO.LOW)
        for i, filename in enumerate(camera.capture_continuous(_pics_root + "/" + now + "-{counter}.jpg")):
            if i == (len(leds)-1):
                break
            time.sleep(2)
            GPIO.output(leds[i+1], GPIO.LOW)
    finally:
        interface.show_image("finished2.png")
        camera.stop_preview()
        camera.close()
Exemple #3
0
def reset():
    interface.init_pygame()
    interface.show_image("intro.png")