To keep the crew mentally sharp and entertained, the new commander has requested a game that challenges the cadets’ memory. As a cadet, you are tasked with creating “Space Memory Match,” a game where LEDs flash in a sequence that the players must remember and replicate. With each round, the sequence gets longer, testing the cadets’ memory and concentration. This game will help improve their cognitive abilities and provide a fun, engaging activity aboard the Nebula Raider.
Components Needed:
Raspberry Pi Pico WH Microcontroller
LEDs (4, different colors or positions)
Push buttons (matching the number of LEDs)
Buzzer (optional for sound feedback)
LCD1602 IIC/I2C Blue Backlight Display
Resistors
Breadboard
Jumper wires
Instructions:
Set Up the Circuit:
Connect each LED to a GPIO pin on the Raspberry Pi Pico (e.g., GP0, GP1, GP2, GP3) with appropriate resistors.
Connect each push button to a GPIO pin on the Raspberry Pi Pico (e.g., GP4, GP5, GP6, GP7) using a pull-down resistor configuration.
Connect the LCD1602 display to the Raspberry Pi Pico using the I2C interface (SDA to GP8, SCL to GP9).
Optionally, connect a buzzer to a GPIO pin on the Raspberry Pi Pico (e.g., GP10) for sound feedback when a button is pressed.
Write the Code:
Open your coding environment and write the following Python code to create the Space Memory Match game.
Test the System:
Upload the code to the Raspberry Pi Pico and run it.
Observe the LEDs flashing in a sequence and try to replicate it by pressing the corresponding buttons.
Ensure the system accurately verifies the user input and provides feedback on the LCD.
Learning Outcomes:
Memory and Concentration: Enhance your memory and concentration by replicating increasingly longer sequences of LED flashes.
Microcontroller Programming: Develop skills in writing code to control LEDs and read input from buttons.
User Interaction: Understand how to create interactive games that provide real-time feedback and challenge users.
Extension Ideas:
Difficulty Levels: Add different difficulty levels with varying sequence lengths and speeds.
Scoring System: Implement a scoring system to keep track of the highest level reached by different players.
Sound Effects: Enhance the game with sound effects for correct and incorrect sequences using the buzzer.
By completing this project, you will have built a fun and challenging memory game for the crew, helping to improve their cognitive abilities while providing entertainment aboard the Nebula Raider.