Esempio n. 1
0
def take_picture(channel):
    lcd.lcd_clear()    
    camera.start_preview()
    camera.annotate_text_size = 150
    for i in range(5):
        camera.annotate_text = "Ready %d" % (5-i)
        output_lcd("#### READY! ####", "        %d" % (5-i))
        MY_CYCLE = colorschemes.RoundAndRound(num_led=NUM_LED, pause_value=1/NUM_LED,
                                              num_steps_per_cycle=NUM_LED, num_cycles=1)
        MY_CYCLE.start()        
#        sleep(1)

    
    thread1 = flash.Flash(2,70)
    thread1.start()

    output_lcd("##### SMIL! #####", "################")

    camera.annotate_text = ""
    filename = '/home/pi/Desktop/capture.jpg'
    camera.capture(filename)
    camera.stop_preview()
    output_lcd("  Uploader... ", "-!-!-!-!-!-!-!-!")
    res = upload(filename)
    if res:
        output_lcd(" Billede klar!", "---------------")
    else:
        output_lcd("!!!!! FEJL !!!!!", "!!!!!!!!!!!!!!!!")
    sleep(2)
    output_lcd(" - Photobooth - ", "Tryk pa knappen")
Esempio n. 2
0
def main():
    # One Cycle with one step and a pause of three seconds. Hence three seconds of white light
    print('Three Seconds of white light')
    my_cycle = colorschemes.Solid(num_led=NUM_LED,
                                  pause_value=3,
                                  num_steps_per_cycle=1,
                                  num_cycles=1,
                                  order='rgb',
                                  global_brightness=BRIGHTNESS)
    my_cycle.start()

    # Go twice around the clock
    print('Go twice around the clock')
    my_cycle = colorschemes.RoundAndRound(num_led=NUM_LED,
                                          pause_value=0,
                                          num_steps_per_cycle=NUM_LED,
                                          num_cycles=2,
                                          order='rgb',
                                          global_brightness=BRIGHTNESS)
    my_cycle.start()

    # One cycle of red, green and blue each
    print('One strandtest of red, green and blue each')
    my_cycle = colorschemes.StrandTest(num_led=NUM_LED,
                                       pause_value=0,
                                       num_steps_per_cycle=NUM_LED,
                                       num_cycles=3,
                                       order='rgb',
                                       global_brightness=BRIGHTNESS)
    my_cycle.start()

    # One slow trip through the rainbow
    print('One slow trip through the rainbow')
    my_cycle = colorschemes.Rainbow(num_led=NUM_LED,
                                    pause_value=0,
                                    num_steps_per_cycle=255,
                                    num_cycles=1,
                                    order='rgb',
                                    global_brightness=BRIGHTNESS)
    my_cycle.start()

    # Five quick trips through the rainbow
    print('Five quick trips through the rainbow')
    my_cycle = colorschemes.TheaterChase(num_led=NUM_LED,
                                         pause_value=0.04,
                                         num_steps_per_cycle=35,
                                         num_cycles=5,
                                         order='rgb',
                                         global_brightness=BRIGHTNESS)
    my_cycle.start()

    print('Finished the test')
Esempio n. 3
0
NUM_LED = 576

# One Cycle with one step and a pause of three seconds. Hence three seconds of white light
print('Three Seconds of white light')
MY_CYCLE = colorschemes.Solid(num_led=NUM_LED,
                              pause_value=3,
                              num_steps_per_cycle=1,
                              num_cycles=1,
                              order='rgb')
MY_CYCLE.start()

# Go twice around the clock
print('Go twice around the clock')
MY_CYCLE = colorschemes.RoundAndRound(num_led=NUM_LED,
                                      pause_value=0,
                                      num_steps_per_cycle=NUM_LED,
                                      num_cycles=2,
                                      order='rgb')
MY_CYCLE.start()

# One cycle of red, green and blue each
print('One strandtest of red, green and blue each')
MY_CYCLE = colorschemes.StrandTest(num_led=NUM_LED,
                                   pause_value=0,
                                   num_steps_per_cycle=NUM_LED,
                                   num_cycles=3,
                                   order='rgb')
MY_CYCLE.start()

# One slow trip through the rainbow
print('One slow trip through the rainbow')