Simon Says Game with LCD
info
Author: Dobrin Andrei Liviu
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-andrei-1-64
Descriptionβ
This project implements a "Simon Says" memory game using 9 LEDs and a numpad. The game logic runs on a Raspberry Pi Pico 2W. An I2C-connected 16x2 LCD screen displays a start menu, current score, and high score saved in the microcontroller's flash memory.
Motivationβ
I chose this project to combine embedded hardware and software concepts in a fun and interactive way. It challenges both my circuit design skills and my ability to use Rust in embedded development.
Architectureβ
The project is made up of several parts that work together to create the Simon Says game:
Game Logicβ
- This is the main part of the program.
- It controls the flow of the game: when it starts, how patterns are shown, and when the game ends.
Pattern Generatorβ
- Generates a random sequence of LEDs that the player has to remember and repeat.
- The sequence gets longer each round to make the game more challenging.
Input Handlerβ
- Listens for button presses from the 4x3 keypad.
- Checks if the player's input matches the generated pattern.
Output Handlerβ
- Controls the 9 LEDs to display the pattern.
- Sends messages to the LCD screen (like score, "You Win", or "Game Over").
- Activates the buzzer to give sound feedback for actions.
Score Systemβ
- Keeps track of the playerβs current score.
- Saves the highest score in the microcontroller's flash memory so itβs not lost when powered off.
How everything connectsβ
- The Game Logic tells the Pattern Generator to make a new sequence.
- The Input Handler reads the playerβs buttons and tells the Game Logic if it was correct.
- The Output Handler lights up the LEDs, updates the screen, and beeps the buzzer.
- The Score System stores the highest score and updates it when needed.
Logβ
Week 5 - 11 Mayβ
Week 12 - 18 Mayβ
Week 19 - 25 Mayβ
Hardwareβ
Detail in a few words the hardware used.
Schematicsβ
Place your KiCAD schematics here.
Bill of Materialsβ
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico W (x2) | The microcontroller | 35 RON |
16x2 I2C LCD Screen | Displays menu and scores | 15 RON |
LEDs (x9) | Lights up in sequence | 4 RON |
330Ξ© Resistors (x9) | LED current limiting | 5 RON |
10kΞ© Resistors (x9) | Pull-down for buttons | 1 RON |
Breadboard | For prototyping | 12 RON |
Jumper Wires | Connect components | 23 RON |
Buzzer | Audio feedback | 3 RON |
Numpad | Controlling the game | 19 RON |
Softwareβ
Library | Description | Usage |
---|---|---|
st7789 | Display driver for ST7789 | Used for the display for the Pico Explorer Base |
embedded-graphics | 2D graphics library | Used for drawing to the display |