Pico Pong
By Nicola King. Posted
After discovering that Raspberry Pi Pico can use its Programmable Input/Output (PIO) capability to output a video signal, Nick Bild was inspired to recreate the arcade classic Pong. Not only that, but he’s made it gesture-controlled.
Advertisement
Get started with Raspberry Pi – everything you need to know to start your journey!
“I love playing old games in RetroPie on my Raspberry Pi 4 with my son Luke,” he tells us, “so when I realised what a perfect fit Pico’s PIO would be for generating a VGA signal, my mind went to a reimagining of one of the greatest games of all time.”
It took Nick about three weeks of nights and weekends to build Pico Pong: “I have a day job, so I have to fit my projects in when I can.”
The difficult part was getting the VGA signal timing just right. “Once I had that locked down, it only took me a couple of hours to code up the Pong algorithm and graphics,” he reveals.

Since Pico’s PIO handles the cycle-intensive process of generating video, this leaves the CPU free to do other work, like play Pico Pong. “I use the PIO to generate a 640×480@60Hz monochrome VGA signal,” says Nick. “Data for the display is stored in a buffer in SRAM, which the PIO program grabs at exactly the right nanosecond, as it paints the screen, via DMA [direct memory access].”
As well as overclocking Pico to 258MHz, nearly double its standard speed, it took a lot of incremental tweaking to get the VGA signals exactly right. “I had to reorganise and rethink the PIO assembly code a number of times to get the data for each pixel on the GPIOs exactly within its 40 nanosecond window.”
Gesture control
The player’s on-screen paddle is gesture-controlled using two infrared (IR) LED / IR phototransistor pairs. “The IR LED shines upward onto a mirror, which reflects the IR light back onto the receiver below,” explains Nick. “When that signal is interrupted (i.e. by a hand), it triggers Pico via GPIO to move the player paddle. One receiver moves the paddle up on the screen, and the other moves the paddle down.”
Why gesture control? “I wanted to do something different from the typical potentiometer controller, so I did some digging through my parts bins to get ideas,” Nick replies. “I first thought I might use a PIR sensor for a similar gesture interface, but even with hardware modifications it wasn’t responsive enough.”
As an alternative, he tried the IR LED/phototransistor pair and responses were smooth and instantaneous. “After playing around with this for a while, I feel like this is the way Pong was meant to be played. If my idea weren’t over 40 years late, I think this could have been the Nintendo Wii of the 1970s.”
Game, set, and match
After showcasing the project on Hackster.io (magpi.cc/picopong), Nick has received plenty of positive feedback from the maker community. “There’s a lot of love for Pong, so I’ve found that many people are drawn to this new way of playing a classic game,” he says. “People see this as something that they could realistically build for themselves, and I think that’s right. With the coding already done, there is only a simple circuit to build, and the Pico is a very inexpensive development board.”
Nick advises us to keep our eyes open for updates to the projects in the future. Meanwhile, he’s currently experimenting with using his Pico to remotely control a toy helicopter. “I’d like to teach it some new tricks, and control it by voice and/or gestures.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
Get started with Raspberry Pi in Raspberry Pi Official Magazine 161
There’s loads going on in this issue: first of all, how about using a capacitive touch board and Raspberry Pi 5 to turn a quilt into an input device? Nicola King shows you how. If you’re more into sawing and drilling than needlework, Jo Hinchliffe has built an underwater rover out of plastic piping and […]
Read more →
Win one of three DreamHAT+ radars!
That’s right, an actual working radar for your Raspberry Pi. We reviewed it a few months ago and have since been amazed at some of the projects that have used it, like last month’s motion sensor from the movie Aliens. Sound good? Well we have a few to give away, and you can enter below. […]
Read more →
RP2350 Pico W5 review
It’s Raspberry Pi Pico 2, but with a lot more memory
Read more →