Ejemplo n.º 1
0
def attention_dp():
    global segments
    for i in range(360):
        segments[7] = color_tools.h_to_rgb((i*4) % 360)
        push_segs()
        time.sleep(2.0/360.0)

    segments[7] = (0, 0, 0)
    push_segs()
Ejemplo n.º 2
0
def attention_dp():
    global segments
    for i in range(360):
        segments[7] = color_tools.h_to_rgb((i * 4) % 360)
        push_segs()
        time.sleep(2.0 / 360.0)

    segments[7] = (0, 0, 0)
    push_segs()
Ejemplo n.º 3
0
def attention():
    order = [0, 1, 2, 3, 5, 4, 6, 7]

    for i in range(len(order) * 6):
        frame = [(0, 0, 0)] * 16
        for offset in range(3):
            if i - offset < 0:
                continue
            offset_color = color_tools.h_to_rgb(
                (((i - offset) * 30.0) + 360) % 360)
            frame_index = order[(i - offset + len(order)) % len(order)]
            brightness = ((3.0 - offset) / 3.0)
            color = (offset_color[0] * brightness,
                     offset_color[1] * brightness,
                     offset_color[2] * brightness)
            frame[frame_index] = color

        fade_frame(frame, 0.2)
Ejemplo n.º 4
0
def show_clock():
    hour = datetime.datetime.now().hour
    hour_text = format(hour, 'X') if hour < 13 else format(hour-12, 'X')
    hour_color = color_tools.h_to_rgb((datetime.datetime.now().minute/15)*90)
    display.show_text(hour_text, 3, 1, 0, hour_color)