Memory Game

by 824300 in Circuits > Arduino

23 Views, 0 Favorites, 0 Comments

Memory Game

another wired breadboard.jpg

This project's use is to have fun while challenging your memory, this project requires you to remember the sequence of the four LEDs and push the buttons in the right order. Looking at the 7-segment display, this component will represent and show you your current level in the game, this game will go up to 9 levels with each level getting increasingly hard by adding more LEDs and speeding up the LED blink speed too. Once the time limit is reached the RGB LED will be either in a green hue or a red hue representing whether you still have time or not. The buzzer also plays a pleasant little melody each time the level is passed or failed and when the game is started. Good luck!

Supplies

All components required.jpg
  • 4x push button
  • 1x 7 - segment led display
  • 1x common anode RGB LED
  • 1x Arduino Uno
  • 1x Long Breadboard - or 2 small breadboard connected together like the one in the image
  • 1x Piezo buzzer
  • 1x 4x 10k resistors 
  • 4x 330 resistors
  • 3x 560 resistors
  • Jumper wires 

Gather All Components Required, Place and Wire All Components.

Only components.jpg
Wired breadboard.jpg
another wired breadboard.jpg

In the first image presented, you can see the components required in place where they should be for this project. The next image shows you the wiring required for this project. and the last picture will show you the finished product.


The 7-Segment Display will be wired to the analog pins which are pins A0 - A5 and pin 2, the reason for this is that there merely weren't enough pins for the seven segments to connect to, so we will be using the analog pins as a substitute. Also a side note, the RGB is a common anode so the green pin can be put into the ground line and only the blue and red pins are needed to be put in the Arduino.

Install the Code Into the Arudino Uno

The game is a memory test that combines both visual and auditory elements. Consisting of four different coloured LEDs, four buttons, an RGB LED, a piezo buzzer, and a 7-segment display.


Gameplay

  • the game generates a random sequence of LED colours and corresponding musical tones after the game is started, you will know when it starts as you will hear a small melody
  • The player must remember and input the sequence via buttons. Each button press triggers a corresponding music note, providing auditory feedback
  • Once the correct sequence is inputted, a small victory song is played through the buzzer, indicating that the player has finished that round and the RGB LED lights up blue
  • If the sequence inputted is incorrect or fails to input the sequence within 10 seconds, the buzzer plays a game over the song and the game restarts
  • The game consists of 9 rounds in total, and the current round is displayed on the 7-segment display
  • to win the entire game, the player must complete all 9 rounds.

Downloads