Simon Says Memory Game With Arduino
by TechMartian in Circuits > Arduino
2429 Views, 11 Favorites, 0 Comments
Simon Says Memory Game With Arduino
![vdltTKS4RJ+QnreRCzqO3w_thumb_b3e.jpg](/proxy/?url=https://content.instructables.com/F2P/WLEB/J6WGLWNE/F2PWLEBJ6WGLWNE.jpg&filename=vdltTKS4RJ+QnreRCzqO3w_thumb_b3e.jpg)
![aaRR%I2xQzyq5UdOoSZ9iA_thumb_b3a.jpg](/proxy/?url=https://content.instructables.com/F7K/ODB2/J6WGLZCG/F7KODB2J6WGLZCG.jpg&filename=aaRR%I2xQzyq5UdOoSZ9iA_thumb_b3a.jpg)
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.
BoM
![lVnb7vWkS5acrGvytF2GMw_thumb_b39.jpg](/proxy/?url=https://content.instructables.com/FQW/LQ89/J6WGLW5B/FQWLQ89J6WGLW5B.jpg&filename=lVnb7vWkS5acrGvytF2GMw_thumb_b39.jpg)
* Arduino
* Push Buttons
* RGB LED
* Breadboard
* Wires
Wiring
![aaRR%I2xQzyq5UdOoSZ9iA_thumb_b3a.jpg](/proxy/?url=https://content.instructables.com/FB2/ZEI6/J6WGLVV3/FB2ZEI6J6WGLVV3.jpg&filename=aaRR%I2xQzyq5UdOoSZ9iA_thumb_b3a.jpg)
![rk1U6EK8QjeCYDS9FrpS%Q_thumb_b3b.jpg](/proxy/?url=https://content.instructables.com/FUL/VUCU/J6WGLWM6/FULVUCUJ6WGLWM6.jpg&filename=rk1U6EK8QjeCYDS9FrpS%Q_thumb_b3b.jpg)
![NfxIBlHwTlqCIAWUOW2gqg_thumb_b3d.jpg](/proxy/?url=https://content.instructables.com/FVU/CGGR/J6WGLWE4/FVUCGGRJ6WGLWE4.jpg&filename=NfxIBlHwTlqCIAWUOW2gqg_thumb_b3d.jpg)
![akUt87vQRwWZFYZjPPRvpQ_thumb_b3c.jpg](/proxy/?url=https://content.instructables.com/FK7/3JPF/J6WGLVWS/FK73JPFJ6WGLVWS.jpg&filename=akUt87vQRwWZFYZjPPRvpQ_thumb_b3c.jpg)
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/O | I/O Pin # | Wire Colour / Description | Arduino pin# |
---|---|---|---|
Red Push Button | 1 | Ground Rail | GND |
2 | White | 10 | |
- | - | - | - |
Blue Push Button | 1 | Ground Rail | GND |
2 | Grey | 12 | |
- | - | - | - |
Green Push Button | 1 | Ground Rail | GND |
2 | Blue | 11 | |
- | - | - | - |
RGB LED | 1 | Right of Longest Pin - RED | 9 |
2 | Longest Pin | GND | |
3 | Centre next to Longest Pin - Green | 5 | |
4 | Farthest from Longest Pin - Blue | 4 |
Code
![Screen Shot 2017-08-29 at 8.31.20 PM.png](/proxy/?url=https://content.instructables.com/FHK/YBV9/J6WGLE7C/FHKYBV9J6WGLE7C.png&filename=Screen Shot 2017-08-29 at 8.31.20 PM.png)
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); } }
Enjoy!
![vdltTKS4RJ+QnreRCzqO3w_thumb_b3e.jpg](/proxy/?url=https://content.instructables.com/FRM/SZUQ/J6WGLZCV/FRMSZUQJ6WGLZCV.jpg&filename=vdltTKS4RJ+QnreRCzqO3w_thumb_b3e.jpg)
Hash out your memorizing skills with this game and enjoy!