4. Summary of Project - BLiverio/ICEN353-Group-7 GitHub Wiki
Given the task to create a Simon Says game, our team first used the schematics given by the professor. We created a system on a breadboard which uses three LEDs and three buttons with one piezo buzzer to play the game. You may see the schematics of our breadboard and Arduino in the “Schematics and Drawings” section of our wiki. The game starts off by using all three lights and blinks them one by one in linear order. Waiting till the user to press a button, the game will then start. If the user correctly presses the the button corresponding with the random LED, then the Arduino will automatically go onto the next round. We programmed it so that there are 10 rounds to win and there is a 5 second pause before you forfeit the game.
The program works by using a random seed generator and based on the number chosen, then the LED corresponding with that number will light up. If the user correctly inputs the output that was generated, then that output will be saved in an array that we created. Then the next round, an output will be generated on top of the previous and it will be saved in the array and played back. Through all of this, there is a counter which is used in the for loop which will cause the program to end once the counter equals 10. The code can be found in the "Code" section of the wiki, and uses comments to show how the game is programmed, what variables are needed, and so on.
In order to configure the hardware, we used the schematics that the professor gave to us to use. We used three LEDs and three buttons with one piezo buzzer. The red LED was connected to pin 11, and along with it, the push button for that LED was connected to pin 2. The blue LED was connected to pin 12, and along with it, the push button for that LED was connected to pin 3. The yellow LED was connected to pin 13, and along with it, the push button for that LED was connected to pin 4. The 330 Ohms resistors connect each push button to its respective LED light. By pressing the button, the LED will turn on when you click on the button, and stay off when the button is not pressed.