from microbit import *

TRIGGER_LEVEL = 150
frame_1 = Image("00000:00000:00000:00000:00000")
frame_2 = Image("00000:00000:00000:00000:00000")
frame_3 = Image("00000:00000:00000:00000:00000")

def light_sequence():
    display.show(frame_1)
    sleep(500)
    display.show(frame_2)
    sleep(500)
    display.show(frame_3)
    sleep(500)
    display.clear()

display.clear()
while True:
    level = microphone.sound_level()
    if level > TRIGGER_LEVEL:
        light_sequence()
    else:
        display.clear()
    sleep(30)
