If you have a bad memory to remember, Memory game is a great idea for improving memory and concentration.
This game is a Simon based game for the Arduino. This project consists of 4 buttons, 4 LEDs, an Arduino, an LCD, and a speaker. In this game, you have to follow the pattern of LEDs/notes as long as you can.
Place 4 different colored LEDs on your breadboard, make sure to note which way the long leg is facing.
Now connect one side of the 100 Ohm resistor to the long leg of each LED.
Connect a jumper wire from one side of the 100-ohm resistor to digital pin 8. Repeat this with the other resistors and connect to digital pin 9-11.
Place your 4 buttons on the breadboard.
Connect a wire from one side of the button to the short leg of the LED and then connect a jumper wire with this side of the button to ground on the Arduino. Repeat this with the other LEDs and push buttons
Connect a jumper wire from the other side of the button to digital pin 2 on Arduino. Same with the other buttons and connect it to pin 3-5.
Connect a jumper wire from a speaker to digital pin 12 and the other wire to the ground.
Connect an I2C LCD to SDA, SCL, VCC, GND on Arduino. SCL is the clock signal, and SDA is the data signal. The clock signal is always generated by the current bus master; some slave devices may force the clock low at times to delay the master sending more data
To power your Arduino you will need a 9v Battery, a 9v battery connector, a switch, a male DC Barrel jack adapter. Solder the switch to the red lead from the 9V battery connector. Connect the black lead from the battery connector to the negative terminal of the jack adapter and connect the lead from the switch to the positive terminal.
Step 3: The Sketch
All you need to do is install 1602 I2C LCD library and Tone library. You will get an error if you don't install.
You can download source code and libraries from here.
When you want to add a new library into your Arduino IDE. Go to the directory where you have downloaded the ZIP file of the library. Extract the ZIP file with all its folder structure in a temporary folder, then select the main folder, that should have the library name. Copy it in the “libraries” folder inside your sketchbook
Step 4: Building a Cardboard Enclosure.
Find a cardboard box that fits the circuit. Don’t forget to make holes for LEDs, buttons and also make the holes to mount the switch and the LCD display. Put the circuit into the enclosure.