Exemplo n.º 1
0
def stop_leds():
    led_list = [
        c.LED_RIGHT, c.LED_MID, c.LED_LEFT, c.LED_FRONT_LEFT, c.LED_FRONT_RIGHT
    ]

    for led in led_list:
        leds.set_led(led, c.OFF)
Exemplo n.º 2
0
def tunnel_licht(in_tunnel: bool):
    if in_tunnel is True:
        zustand = c.ON
    else:
        zustand = c.OFF

    for led in [c.LED_FRONT_LEFT, c.LED_FRONT_RIGHT]:
        leds.set_led(led, zustand)
Exemplo n.º 3
0
def aufmerksamkeit(nano):
    sleep(0.1)

    for _ in range(3):
        leds.set_led(c.LED_RIGHT, c.GREEN)
        nano.set_buzzer(100, 400)
        sleep(0.3)
        leds.set_led(c.LED_RIGHT, c.OFF)
        sleep(0.3)
Exemplo n.º 4
0
def blink(dir_b, times=3):
    if dir_b == "left":
        led = c.LED_LEFT
    elif dir_b == "right":
        led = c.LED_RIGHT

    for _ in range(times):
        leds.set_led(led, c.RED)
        sleep(0.3)
        leds.set_led(led, c.OFF)
        sleep(0.3)
Exemplo n.º 5
0
def wait_for_start():
    leds.set_led(c.LED_MID, c.GREEN)
    buttons.wait_for_button_press(c.BUTTON_MID)
    leds.set_led(c.LED_MID, c.OFF)
    sleep(0.5)