''' Mission 7 - Personal Billboard Medium Remix 2C This project uses a second list for audio MP3 files to play while the image is display. I chose short clips, so a sleep is included. If students choose the long songs, you have to wait until the song finishes, so no delay is needed. - It includes a button to break the loop and quit - ''' from codex import * from time import sleep choice = 0 my_list1 = [pics.HAPPY, pics.PLANE, pics.TSHIRT, pics.TIARA, pics.HEART, pics.HOUSE] my_list2 = ["sounds/up", "sounds/left", "sounds/right", "sounds/down", "sounds/on", "sounds/off"] LAST_INDEX = len(my_list1) - 1 # MAIN PROGRAM while True: my_image = my_list1[choice] my_sound = my_list2[choice] display.show(my_image) audio.mp3(my_sound) # included so audio clip isn't continuous sleep(1) # scroll backward and forward if buttons.was_pressed(BTN_L): choice = choice - 1 if choice < 0: choice = LAST_INDEX if buttons.was_pressed(BTN_R): choice = choice + 1 if choice > LAST_INDEX: choice = 0 # break out of loop and quit if buttons.was_pressed(BTN_D): break