Simon Says Memory Game With Arduino

809

10

About: Born in Pluto, Raised in Mars

This is a memory game made with an Arduino where you repeat the pattern that the coloured LED emits just like the Kid's game "Simon Says," but in a smaller form factor DIY style!

If you're looking to improve your memory skills to just want to play a challenge with your Arduino this is the project for you.

Step 1: BoM

* Arduino

* Push Buttons

* RGB LED

* Breadboard

* Wires

Step 2: Wiring

Follow the table below on how to wire the electronics components to the Arduino with additional help from the reference images above. The wire colours and description is also provided below.

I/OI/O Pin #Wire Colour / DescriptionArduino pin#
Red Push Button1Ground RailGND
2White10
----
Blue Push Button1Ground RailGND
2Grey12
----
Green Push Button1Ground Rail GND
2Blue11
----
RGB LED1Right of Longest Pin - RED9
2Longest PinGND
3Centre next to Longest Pin - Green5
4Farthest from Longest Pin - Blue4

Step 3: Code

const int bred = 10;
const int bgreen = 12;
const int bblue = 11;
//rgb led
const int red = 9;
const int green =5 ;
const int blue = 4;
int point = 0;
void setup() {
  pinMode (bred, INPUT);
  pinMode (bgreen, INPUT);
  pinMode (bblue, INPUT);
  pinMode (red, OUTPUT);
  pinMode (green, OUTPUT);
  pinMode (blue, OUTPUT);
}
void loop() {
  int randomN = random(1,3); // min max
  if (randomN == 1) {
    digitalWrite (red, HIGH);
    if (digitalRead (bred) == LOW){point +=1;}
  } else if (randomN == 2){
    digitalWrite (green, HIGH);
    if (digitalRead (bgreen) == LOW){point +=1;}
  } else if (randomN ==3) {
    digitalWrite (blue, HIGH);
    if (digitalRead (bblue) == LOW){point +=1;}
  } else {
    digitalWrite (red, LOW);
    digitalWrite (green, LOW);
    digitalWrite (blue, LOW);
  }
  
}

Step 4: Enjoy!

Hash out your memorizing skills with this game and enjoy!

Share

    Recommendations

    • PCB Contest

      PCB Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Toys Contest

      Toys Contest

    Discussions