$USD
  • EUR€
  • £GBP
  • $USD
PROJECTS Arduino

The Memory Game

DFRobot Aug 09 2019 328

Things used in this project

Hardware components

Arduino UNO & Genuino UNO ×1

9V battery (generic) ×1

Switch ×1

Jumper wires (generic) ×1

Male Dc Barrel Jack Adapter For Arduino ×1

Breadboard (generic) ×1

DFRobot I2C 16x2 Arduino LCD Display Module ×1

Adafruit Standard LCD - 16x2 White on Blue ×1

Push Button ×1

Resistor 100 ohm ×1

4 different colored LEDs ×1

Speaker: 0.25W, 8 ohms ×1


Story

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.


Step 1: Materials Needed

Arduino: https://amzn.to/2qU18sO

I2C LCD Module: https://amzn.to/2NkVQje

16x2 LCD: https://amzn.to/2LlYrJ7

9v battery: https://amzn.to/2zIcBmL

Switch: https://amzn.to/2upTngE

Jumper wires: https://amzn.to/2zKePBX

Cardboard: https://amzn.to/2JtgVFZ

Speaker: https://amzn.to/2qRuE2B

Male DC Barrel Jack Adapter for Arduino: https://amzn.to/2DLx6jI

4 Push Button: https://amzn.to/2qRwssp

100 Ohm Resistor: https://amzn.to/2Q8zxCs

4 different colored LEDs: https://amzn.to/2Kb6EQA

9v Battery Connector: https://amzn.to/2r3TeNP


Step 2: Making the Circuit on Breadboard

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.


Step 5: Finish


Schematics

Memory Game


Code

Github

https://github.com/IsmailSan/Memory-Game

IsmailSan / Memory-Game

No description — Read More

Latest commit to the master branch on 11-19-2018    Download as Zip


This article copied from hackster.io, Author: Ikhsan Ismail

REVIEW