Using the concepts we have learned till now, we will make a game known as Simon Says. This is how the game works:
There are four LEDs though with a sequence of four number is shown through LED blinking. Like, 1, 2, 1, 4 sequence means first LED will blink first, then second, then first again and the at last fourth one.
There are four tactile switches also, for user input.
There is an extra tactile switch to start the game.
When the game starts, LED start blinking in a random sequence. You have to remember it and enter the same sequence using corresponding tactile switches.
The game starts at Level 1. If you input correct sequence, you proceed to Level 2 where the LED blinking rate is faster. If you input incorrect sequence, the game gets over and all LEDs blink 3 times.
This is the game. Here is the demonstration of the same:
So you know how the game works. We have to first make the circuit:
LED 1, 2, 3, 4 is connected to digital pin 2, 3, 4 and 5 respectively.
Switch 1, 2, 3 and 4 is connected to digital pin 8, 9, 10 and 11 respectively.
Game Start Switch is connected to digital pin 6.
Before you copy and paste code, try to make the code on your own. If you are getting a problem you can refer to the code below:
You must take a picture of the circuit you made and upload it to the website. Submitting the assignment is a must in order to receive the certificate after completing the course.
Follow the steps below to upload your assignment:
Click on Choose File.
Select your image from the pop-up window that opens up.
Once the image is selected, click on Upload Assignment.
File types that are allowed are PNG, JPG, and JPEG. The maximum file size allowed is 5 MB.