import runloop
from hub import button, light_matrix, sound

async def main():
    # Show heart, play C5 (523Hz), and hold 0.7s
    light_matrix.show_image(light_matrix.IMAGE_HEART)
    await sound.beep(523, 250, 100)
    await runloop.sleep_ms(700)

    # Switch to surprised face, play E5, hold 0.7s
    light_matrix.show_image(light_matrix.IMAGE_SURPRISED)
    await sound.beep(659, 250, 100)
    await runloop.sleep_ms(700)

    # Scroll GO and wait until Hub Left button is pressed
    await light_matrix.write("GO")
    while button.pressed(button.LEFT) == 0:
        await runloop.sleep_ms(20)

    # Celebrate with a happy face and two-note fanfare
    light_matrix.show_image(light_matrix.IMAGE_HAPPY)
    await sound.beep(784, 200, 100)
    await sound.beep(1046, 300, 100)

runloop.run(main())
