Recreating Pong with an LED matrix
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.