SP.710 Lab 1 : Simon (14 February 2000) 1. WIRING Wire up your protoboard for Simon, either for one of the pre-made simon game modules or for four buttons and four LEDs of your own. Have an instructor check your wiring before proceeding. 2. TESTING Write a simple program that has each LED turn on if the corresponding button is being pressed. Try it out; this will test your wiring, the buttons, and the LEDs. 3. SWITCH DEBOUNCE AND VARIABLES Write a program that has each button toggle the corresponding LED; that is, each time you press a button it turns that LED on or off. 4. ARRAYS Write a program that plays an arbitrary Simon sequence on the LEDs when you turn it on; make it so that the sequence is stored in an an array so it's easy to change. 5. MORE ARRAYS Write a program that plays part of a Simon sequence (again stored in an array) each time you press a button: the first time you push a button the first light flashes, the second time the first two lights flash, and so on. 6. PUTTING IT ALL TOGETHER Make a program that plays a simple Simon game. Have the sequence be stored in an array. Pick one LED for "win" and another for "lose": if the player makes it through the whole game, turn on the win LED and wait, and if the player pushes a wrong button, turn on the lose LED and wait. Start over if the user pushes any button. 7. PIC-TO-COMPUTER COMMUNICATIONS Alter your Simon game so it tells you you've won or lost over the serial port, and tells you how far you got (i.e. how long the final sequence was.) 8. RANDOM NUMBERS Make your sequences be randomly generated so they're different each time you play. You will have to seed your random number generator with a fixed value, so the sequence will still be the same if you reset the PIC. 9. EEPROM (LONG-TERM MEMORY) Alter your random-number algorithm so it stores it's state in EEPROM, so the numbers will be different each time you reset. 10. TIMERS Use a timer to alter your program so that the user has only some fixed time (a second or two) to push each button.