Skip to content
All prices in US$ - All orders receive free delivery, worldwide - Click here to learn more
All prices in US$ - All orders receive free delivery, worldwide - Click here to learn more
Recreating Pong with an LED matrix

Recreating Pong with an LED matrix

from arduino.cc

Tennis for Two is one of the very first video games in history. It eventually inspired Atari’s Pong, which itself spawned many derivatives. Tennis for Two outputted vector graphics to an oscilloscope and had an elevation view of the “tennis court,” complete with gravity. Pong had pixel-based raster graphics with a simpler top-view. That worked better at low resolutions and with more basic physics algorithms, which is why exposedwire chose it for this LED Pong project.



This electronic game plays like Atari’s Pong, but with an LED matrix game screen instead of raster graphics. There are only two controls: a pair of rotary encoders to control the two player paddles. Those sit in a simple and attractive 3D-printed enclosure. However, there isn’t any scoreboard. That means that players must track the score themselves.



An Arduino Nano board controls the 16×8 grid of LEDs. That is a total of 128, which is far more than the number of I/O pins available on the Nano (22). A matrix setup reduces the number of required pins down to a minimum of 23 for 128 LEDs, though adhering to the 16×8 grid structure simplifies wiring and requires 24 pins. That’s still more than is available on a Nano, so this project uses three shift registers: one for the eight positive rows and two for the 16 negative columns.



With that hardware, programming the game logic in a sketch was a matter of moving the ball according to a simple algorithm and tracking the LED states in a two-dimensional array. Very few video games are coded this way today, but this is a great demonstration of early techniques that were common for less-powerful hardware.

Finally - to keep up to date with interesting news, offers and new products - interact with us on facebookinstagram, and twitter.

Previous article This handy machine automatically cuts plastic gears
Next article Learn Microchip AVR Programming with “AVR Workshop A Hands-On Introduction with 60 Projects”

Leave a comment

Comments must be approved before appearing

* Required fields