Simon says is a simple electronic memory game: the user has to repeat a growing sequence of colors. The sequence is displayed by lighting up the LEDs. Each color also has a corresponding tone.
In each turn, the game will play the sequence, and then wait for the user to repeat the sequence by pressing the buttons according to the color sequence. If the user repeated the sequence correctly, the game will play a "leveling-up" sound, add a new color at the end of the sequence, and move to the next turn.
The game continues until the user has made a mistake. Then a game over sound is played, and the game restarts.
Check out the online simulation at https://wokwi.com/projects/371755521090136065 (including wiring diagram).
You need four buttons, four LEDs, resistors, and optionally a speaker/buzzer and a two digit 7-segment display for the score.
Ideally, you want to use 4 different colors for the buttons/LEDs (red, green, blue, yellow).
btn1
, btn2
, btn3
, and btn4
, and also
connect each button to a pull down resistor.led1
, led2
, led3
, and led4
, matching
the colors of the buttons (so led1
and btn1
have the same color, etc.)speaker
pin.seg_a
through sev_g
to
individual segments, dig1
to the common pin of the tens digit, dig2
to the common pin of the ones digit.
Set seginv
according to the type of 7 segment display you have: high
for common anode, low for common cathode.Note: the game requires 50KHz clock input.
Four push buttons (with pull-down resistors), four LEDs, and optionally a speaker/buzzer and two digit 7-segment display
# | Input | Output | Bidirectional |
---|---|---|---|
0 | btn1 | led1 | seg_a |
1 | btn2 | led2 | seg_b |
2 | btn3 | led3 | seg_c |
3 | btn4 | led4 | seg_d |
4 | seginv | speaker | seg_e |
5 | dig1 | seg_f | |
6 | dig2 | seg_g | |
7 |