Get all your news in one place.
100’s of premium titles.
One app.
Start reading
Tom’s Hardware
Tom’s Hardware
Technology
Ash Hill

This Raspberry Pi Pico plays Pong using persistence of vision and custom mouse firmware

Raspberry Pi.

We often point out the Raspberry Pi's beautiful relationship with gaming—especially retro gaming. But we never expected retro gaming on the Raspberry Pi to be like this. Maker and developer Guy Dupont is at it again, this time using an RP2040 to play a game of Pong on the firmware of his mouse.

You're not alone if you're wondering how to play a game with mouse firmware. The way Dupont has pulled this off is fascinating and impressive. In a nutshell, it moves the cursor rapidly to generate a "persistence of vision," which is essentially an illusion that makes the cursor appear in multiple locations at once. The RP2040 hosts the game by intercepting the mouse input to the PC.

Dupont programmed a few controls to operate the game, but it also functions like a regular mouse when not used to simulate Pong. The Pong game has a scorekeeping system but doesn't represent the score using numbers. Instead, the cursor will appear closer to the winning side after a point is scored. The cursor will move closer and closer to the winning side as the score increases but rest in the middle of the score when tied.

(Image credit: Guy Dupont)

Dupont was kind enough to share details on how the project goes together and what you can do to recreate it at home. You don't need a special mouse; Dupont is using a generic HP mouse. You'll need an RP2040 board with a second USB port, but if you aren't sure where to start, Dupon recommends an Adafruit Feather RP2040 with a USB Host.

Because he's using the Adafruit Feather RP2040, he programmed it using the TinyUSB Arduino Library. That said, your mileage may vary if you choose to use a different board. The complete source code for the project is available at Github.

Sign up to read this article
Read news from 100’s of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
One subscription that gives you access to news from hundreds of sites
Already a member? Sign in here
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.