Arduino Memory Game

by Jonluca29 in Circuits > Arduino

101 Views, 1 Favorites, 0 Comments

Arduino Memory Game

0.jpg
0.jpg

This silly little Arduino project I made is a fully functioning memory game! It utilizes LEDs of multiple colours, a piezo buzzer, and buttons. The way the game works is you are shown a sequence of colours from the LEDs. You must then replicate that sequence by pressing the buttons corresponding to the correct LED. If you get it right you are shown the same sequence but with an extra step to it. The game continues on and on until you lose!

Supplies

  • Arduino
  • Jumper wires
  • Piezo buzzer
  • Red LED
  • Green LED
  • Yellow LED
  • Blue LED
  • 4x buttons
  • 4x 330 Ohm resistors
  • 4x 10k Ohm resistors
  • Breadboard

Place the LEDS, Buttons, Buzzer, and Resistors to the Breadboard

Screenshot 2024-06-16 191220.png

Place the LEDS, buzzer, buttons, and resistors into the breadboard like so in the image provided. Ensure that there is adequate spacing between the LEDs, buttons, and piezo to get a neat and organized look. Make sure the negative legs of the piezo and LEDS are connected to the ground rail of the breadboard. Connect a 10k resistor to one leg of the buttons to the ground rail too.

Connect Everything to the Arduino

Screenshot 2024-06-16 191903.png
0.jpg

Using Jumper wires connect the following LEDs and piezo follows:

  1. Red LED to pin 7
  2. Green LED to pin 8
  3. Yellow LED to pin 9
  4. Blue LED to pin 10
  5. Pizeo buzzer to pin 12

Using Jumper wires again connect the corresponding buttons of the LEDs to the Arduino:

  1. Red button to pin 2
  2. Green button to pin 3
  3. Yellow button to pin 4
  4. Blue button to pin 5

Upload the Code

Now for the final step. Uploading the code! I have provided the fully finished code that you can look through and use to make your own version of this memory game!

Downloads