Arduino

# DIY addictive Arduino 1D Pong game

July 13, 2024 by Mirko Pavleski
Share

This is an interesting one-dimensional compact version of the classic "Pong" game made with a minimal number of components, yet extremely addictive.

Pong is a table tennis–themed 2 dimensional graphics arcade video game manufactured by Atari and originally released on 1972.

This time I will present you a simple way to make a 1D LED Pong game which is an interesting project that simulates a Pong game on a single-dimensional array of LEDs. This can be done using Arduino microcontroller board. The movement of the ball is simulated by the array of LEDs, and the paddles are the two buttons. The game is for 2 players, in which the "ball" travels down the length of the LED array, and will bounce back if the button is pressed when yellow LED is illuminated.

The result is displayed on the LCD screen. The movement of the ball, the winning of a point as well as the victory are accompanied by appropriate sounds

The device is very simple to make and consists of several components:

- Arduino Nano microcontroller board

- 16x2 LCD Display

- 10 Leds

- 12 resistors

- two buttons

- and Buzzer

The game starts by moving the ball from player 1 to player 2, and if player 2 fails to press the button while the yellow LED is on, the red LED will light up and it's a point for player 1. Each game is started by the winner of the previous one. The speed of the ball is increases after every hit, making it more difficult to hit the ball in time. The match ends when one of the players wins 10 games, and at that moment the Leds that are on the winner's side will flash.

- The starting speed of movement of the LEDs is set in the row:

const unsigned long initialMillisecondsPerLED = 400;

The lower this number, the faster the movement speed

- The degree of acceleration after each hit is adjusted in the rows:

if (deltaMillisecondsPerLED > 50)

{

deltaMillisecondsPerLED -= 50;

and the higher this number is, the higher the acceleration.

The game can be played by one or two players. In the case of two players, which is a natural option, it is preferable to use robust external arcade buttons.

For this purpose I used these buttons that I made for the needs of one of my previous projects. They are large, and have a precise, and audible click.

Finally a short conclusion. This is an interesting one-dimensional compact version of the classic "Pong" game made with a minimal number of components, yet extremely addictive, and can be played for hours before you get bored. The device is mounted in a suitable box made of PVC board and lined with self-adhesive wallpaper. For power, it is preferable to use a lithium battery for the sake of mobility