A simple memory game built on the ESP8266, using 74HC595 and 74HC165 shift registers to control LEDs and read buttons with minimal GPIO usage for them. The game shows a random color sequence on LEDs that the player must repeat using buttons. If the player matches the sequence, the game adds a new random color until reaching a maximum of 10 colors. If the player makes a mistake, the game ends.
This project combines what was learned in these earlier repos:
- Part 1: 74HC595 – Output Expansion
- Part 2: 74HC165 – Input Expansion
Now, in Sequence-Memory, we use both together to build an actual interactive game.
- How to use both 74HC595 and 74HC165 simultaneously
- How to create a memory-based color sequence game
- How to use shared clock lines efficiently
- Combining input reading and LED control with minimal GPIOs
- The game starts with a random sequence of 4 colors (Red, Yellow, Green, Blue).
- Colors are represented by specific bits in a byte sent to the 74HC595, lighting up LEDs.
- The player repeats the sequence by pressing corresponding buttons (read via 74HC165).
- If correct, a new random color is added to the sequence.
- The game continues until the player makes a mistake or reaches the max length.
- ESP8266 (NodeMCU, Wemos D1 mini, etc.)
- 74HC595 (Output shift register)
- 74HC165 (Input shift register)
- 4 LEDs: Red, Yellow, Green, Blue
- 4 Push buttons
- Buzzer
- Breadboard + jumper wires
- Pull-down resistors (10kΩ)
- Clone this repository:
git clone https://github.com/Yamil-Serrano/Colors-Sequence-Memory.git- Open
src/main.cppin Arduino IDE or PlatformIO. - Wire the circuit following the schematic (coming soon).
- Upload and play!
This project is licensed under the MIT License – see the LICENSE file for details.
If you have any questions or suggestions, feel free to reach out to me:
GitHub: Neowizen