示例#1
0
文件: twee.py 项目: quarkness/blinkr

def doe_de_rode_lampjes_aan():
    group_status(rode_lampjes, True)


def doe_dit_lampje_aan(lampje):
    GPIO.output(lampje, True)


while jorrit == 10:
    # print "jazeker"
    time.sleep(0.2)
    if groene_knop_ingedrukt():
        print "de groene knop is ingedrukt!!!!"
        led_toggle(discolampje)

    if rode_knop_ingedrukt():
        aantal_keer_ingedrukt = aantal_keer_ingedrukt + 1
        print "de rode knop is %s keer ingedrukt!!!!" % aantal_keer_ingedrukt
        if aantal_keer_ingedrukt == 1:
            doe_de_gele_lampjes_aan()
        if aantal_keer_ingedrukt == 2:
            doe_de_gele_lampjes_uit()
        if aantal_keer_ingedrukt == 3:
            doe_de_gele_lampjes_aan()
            doe_dit_lampje_aan(discolampje)
        if aantal_keer_ingedrukt == 4:
            doe_de_rode_lampjes_aan()

    if rode_knop_ingedrukt() and groene_knop_ingedrukt():
示例#2
0
文件: app.py 项目: quarkness/blinkr
def led(led):
    led_toggle(led)
    # os.system("mpg123 /usr/share/scratch/Media/Sounds/Effects/WaterDrop.mp3&")
    os.system("sudo fswebcam --no-banner --skip 3  -r 162x120 -D 1 /home/pi/blinkr/static/test.jpeg")
    return redirect('/')
示例#3
0
文件: disco.py 项目: quarkness/blinkr
if __name__ == '__main__':
    var = 1
    while var == 1:

        # if button_pressed():
            for i in range(5):
                leds_status(True)
                time.sleep(0.1)
                leds_status(False)
                time.sleep(0.1)

            # random blinking
            for i in range(25):
                led = choice(all_leds)
                led_toggle(led)
                led = choice(all_leds)
                led_toggle(led)
                time.sleep(.1)

            yellow_blink_red_blink()

            leds_status(False)

            # # from left to right
            for i in range(5):
                led_status(r1, True)
                led_status(g1, True)
                time.sleep(.2)
                led_status(r1, False)
                led_status(r2, True)