1. ro
  2. en
28 July 2025

Repeat After Me: Reverse Mode

Introduction

 

In the basic version of the game, the player must repeat a sequence of visual and audio cues. But the real challenge begins in the extended version: memorizing and reproducing the sequence in reverse. This functionality pushes working memory and logical thinking to the limit. Each level adds a new piece to the puzzle, and mistakes are met with dramatic audio-visual effects. On the other hand, progress is rewarded with a cheerful melody and a rising score displayed digitally.

 

This game can be used as a teaching tool, a cognitive exercise for children or seniors, or a testing platform for electronics and programming enthusiasts. With a modular design, line-by-line commented code, and accessible components, the project is ideal for beginners and advanced makers alike — especially those looking to add Wi-Fi, global scoreboards, EEPROM saving, or mobile interfaces.

 

How the game actually works

 

The game begins when the player presses the red button, clearly indicated by the glowing “RED” text on the TM1637-controlled display and the blinking red LED. This initial interaction triggers a countdown from three, accompanied by short beeps. When it reaches zero, the display clears and the first level is generated: a random sequence consisting of a lit LED and a matching tone.

 

The player watches and memorizes the sequence — but here’s the twist: they must repeat it in reverse order by pressing the buttons in the opposite sequence.

 

Each button press triggers instant visual and audio feedback, and the system checks each step for accuracy. If the input is correct, the level is displayed and a triumphant melody plays. The game then continues seamlessly to the next level, adding one more step to the sequence. This creates a progressively challenging experience that tests memory and attention more intensely with each round.

 

If the player makes a mistake, the system responds with a dramatic “wah-wah” tone and a theatrical exit — encouraging them to try again and beat their previous score. The display alternates between the final score and a blank screen, the LEDs turn off, and the game resets. The “RED” message and countdown return, and the experience starts again from level zero.

 

Through this rhythmic blend of light, sound, and interaction, the game creates an engaging, accessible, and fun learning environment.

 

Game Rules – Repeat After Me: Reverse Mode

 

1. Starting the Game

The game starts when the red button is pressed, indicated by the glowing “RED” text on the TM1637 display and the rhythmic blinking of the red LED. This action triggers a countdown — 3, 2, 1 — accompanied by short tones, setting the stage for the challenge.

 

2. Sequence Generation

After the countdown, the system generates a random sequence consisting of:

  • A colored LED lighting up (red, yellow, green, or blue)

  • A matching audio tone

The player must observe and memorize the exact order of colors and sounds.

 

3. The Reverse Challenge

Here’s the twist: the player must reproduce the sequence in reverse order — pressing the buttons in the opposite order from what was shown. Each press triggers immediate visual and audio feedback, and the system checks each step for accuracy.

 

4. Response & Progress

  • Correct answer: A triumphant melody plays, the level is displayed, and the game continues with a new, longer sequence (one additional color or tone).

  • Incorrect answer: The system plays dramatic “wah-wah” tones, signaling the end of the game. The display flashes, LEDs turn off, and the game resets — returning to the “RED” message and countdown.

 

5. Game Objective

Each level becomes more challenging, demanding greater attention to detail. It’s a rhythmic, engaging, and accessible experience — perfect for:

  • Training focus and concentration

  • Developing visual-auditory coordination

  • Encouraging learning through play

 

 

 

🔌 The Circuit Diagram

 

At first glance, the circuit diagram might look intimidating—its lines twisting and turning like a never-ending technical tale. But don’t let appearances discourage you. We’ll walk through it together, step by step, decoding each symbol and uncovering the logic behind the layout. As we place the components onto the breadboard in a clear and intuitive way, you’ll see how quickly confusion turns into curiosity—and curiosity into confidence.

 

 

Wiring Overview: Connecting the Circuit

 

As you can see, the circuit is built from a series of straightforward connections between the Arduino and various components. Each wire has a purpose, and together they form the backbone of the game’s interactive experience. Here's how everything links up:

 

🔴 Red Button & LED

  • Red Button Terminal 1 → Arduino Pin D12

  • Red Button Terminal 2 → Arduino GND

  • Arduino Pin D7 → Resistor R1 (Terminal 1, for Red LED)

  • Resistor R1 (Terminal 2) → Positive (+) leg of Red LED

  • Negative (−) leg of Red LED → Arduino GND

 

🟡 Yellow Button & LED

  • Yellow Button Terminal 1 → Arduino Pin D6

  • Yellow Button Terminal 2 → Arduino GND

  • Arduino Pin D10 → Resistor R2 (Terminal 1, for Yellow LED)

  • Resistor R2 (Terminal 2) → Positive (+) leg of Yellow LED

  • Negative (−) leg of Yellow LED → Arduino GND

 

🟢 Green Button & LED

  • Green Button Terminal 1 → Arduino Pin D8

  • Green Button Terminal 2 → Arduino GND

  • Arduino Pin D4 → Resistor R3 (Terminal 1, for Green LED)

  • Resistor R3 (Terminal 2) → Positive (+) leg of Green LED

  • Negative (−) leg of Green LED → Arduino GND

 

🔵 Blue Button & LED

  • Blue Button Terminal 1 → Arduino Pin D9

  • Blue Button Terminal 2 → Arduino GND

  • Arduino Pin D5 → Resistor R4 (Terminal 1, for Blue LED)

  • Resistor R4 (Terminal 2) → Positive (+) leg of Blue LED

  • Negative (−) leg of Blue LED → Arduino GND

 

🔊 Speaker

  • Positive (+) terminal of Speaker → Arduino Pin D12

  • Negative (−) terminal of Speaker → Arduino GND

 

🖥️ TM1637 Display

  • CLK (Terminal 1) → Arduino Pin D3

  • DIO (Terminal 2) → Arduino Pin D2

  • GND (Terminal 3) → Arduino GND

  • VCC (Terminal 4) → Arduino 5V

 

 

 

Materials Needed

 

  • Arduino Uno or a compatible equivalent board

  • 4 LEDs (preferably 5mm) in different colors: red, yellow, green, and blue

  • 4 momentary push buttons (normally open) that can be mounted on a breadboard

  • 1 four-digit, seven-segment display controlled by a TM1637 driver chip

  • a speaker for sound feedback

  • 1 large breadboard (830 tie-points recommended)

  • Jumper wires for all necessary connections

 

 

 

🛠️ Installing Components on the Breadboard

 

As you’ll notice, the number of electrical connections required is quite manageable. You just need to pay attention to a few key details to ensure everything is set up correctly:

  • LEDs are polarized components, meaning they must be connected in the correct direction. To help guide you, we’ve labeled the legs as A (anode, +) and K (cathode, −). If installed backwards, the LEDs won’t light up.

 

  • Push buttons have four pins arranged in a rectangular layout—not a perfect square. This means they naturally fit into the breadboard in only one orientation, without forcing them.

  • Resistors are non-polarized, so they can be placed in either direction. Their role is to limit current and protect sensitive components, especially the LEDs.

  • The speakers may come with colored wires. If the terminals aren’t marked, remember: the red wire typically indicates the positive side and should be connected to Pin D12, while the black wire goes to GND.

  • Breadboard power rails are grouped in sets of 25 pins along the sides. To ensure consistent voltage across the board, it’s important to bridge the power rails—this keeps the power supply uniform throughout the entire length of the breadboard.

  • If this is your first time using an Arduino board, you can connect everything without worry. A fresh board won’t have any preloaded programs, so there’s no risk of unexpected behavior during setup.

 

 

 

Source Code

 

Before compiling the source code, you’ll need to install a library that enables communication with the 4-digit, 7-segment display powered by the TM1637 driver chip. The library is called “TM1637”, developed by Avishay Orpaz.

To install it:

  • Open the Library Manager in the Arduino IDE

  • Search for “TM1637”

  • Select “TM1637 by Avishay Orpaz”

  • Click “INSTALL”

 

You can download the source code here. The file includes detailed comments explaining nearly every line, making it easy to follow and customize.

 

Note: The link opens a .ino file in a new browser tab. Since most browsers treat it as plain text, you’ll need to save it properly:

  • Press Ctrl + S

  • In the “Save as type” dropdown, choose “All files”

  • Add the .ino extension to the filename (e.g., RepeatAfterMe.ino).  Alternatively, you can copy the entire code (Ctrl + A, then Ctrl + C), open a new sketch in the Arduino IDE, and paste it (Ctrl + V) directly.

 

Once your components are installed on the breadboard, simply upload the code to your Arduino board and enjoy the game! 🎮

 

 

And That’s Not All…

You can take this project to the next level by integrating all components into a custom enclosure. If you have access to a 3D printer, you can design an attractive and ergonomic case tailored to your layout and style.

No 3D printer? No problem — an ABS plastic box, commonly used in electrical installations, is a great alternative. It offers durability, safety, and a clean, professional appearance.

With a proper enclosure, your project gains not only functionality but also a presentation that truly stands out.

Explore the resources and design ideas here...

 

 

 

You’ve conquered Reverse Mode? Then get ready — your speed and reflexes are about to be tested in Whack-a-Mole. Risk it all in a single second!

 

​​​​​​​

​​​​​​​