Pico Pong!
Play gesture-controlled Pong with a Raspberry Pi Pico!
How It Works
A Raspberry Pi Pico generates a 640x480@60Hz monochrome VGA signal. Due to memory constraints, the usable screen size is 640x350. I would like to say that I chose monochrome because it has the proper retro look for Pong, but actually I just got tired of struggling to fit a cycle-perfect VGA generator into the tiny 32-instruction deep PIO instruction memory and had no will left to squeeze in color.
Data for the display is stored in a buffer in RAM, which the PIO program grabs at exactly the right nanosecond as it paints the screen via DMA. This leaves the CPU free to do other work, like play a game, while the PIO handles the cycle-intensive process of generating a VGA signal. The CPU simply needs to update the appropriate memory locations as needed to change the video output.
Fortunately the Raspberry Pi Pico is known for its ability to be overclocked. I had to run it at over 258 MHz to get everything working correctly—not bad for a board rated at 133 MHz.
The player paddle is controlled by two infrared (IR) LED / IR phototransistor pairs. The IR LED shines upward onto a mirror (held in place by a QuadHands), which reflects the IR light back onto the receiver. When that signal is interrupted (i.e. by a hand), it triggers the Pico via GPIO to move the player paddle. One receiver moves the paddle up on the screen, and the other moves the paddle down. I was surprised by how smooth and natural an interface this ended up being for Pong; much nicer than a potentiometer. It feels a bit like playing a Wii game, if the Wii came out in the 1980s. The paddle on the left side of the screen is computer controlled.
Media
YouTube:
Playing Pong:
The gesture controller:
The Pico and VGA breakout board:
Schematic:
Bill of Materials
1 x Raspberry Pi Pico
2 x 940nm IR phototransistors
2 x 940nm IR LEDs
1 x VGA breakout adapter
3 x 100 ohm resistors
3 x 387 ohm resistors
2 x 10 ohm resistors
2 x 10K ohm resistors
2 x Breadboards
Small disc mirrors
Miscellaneous wire
Pico Pong!
- Comments(0)
- Likes(4)
- Engineer Sep 29,2024
- Engineer Dec 11,2023
- T Wright Oct 24,2021
- (DIY) C64iSTANBUL May 20,2021
- 1 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
10design
-
10usability
-
10creativity
-
10content
More by Engineer
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
154 1 1 -
-