Playing Pong on the Video Game Shield with Potentiometers
We recently received quite a lot of requests for a video game that doesn’t need Wii controllers. This afternoon I took ten minutes and adapted our popular two-player PONG game to use two potentiometers as controllers, instead of the Wii Nunchucks. The potentiometers will be connected to the Arduino’s analog inputs 0 and 1.
I used two trimmer-style potentiometers mounted in a breadboard. These potentiometers have three leads, and the center lead is commonly called “the wiper”. Connect the other two pins to 5v and Ground, and connect the wiper to analog 0 / analog 1. As the potentiometer is turned, the wiper will have a voltage between 0 and 5 volts, which is measured by the Arduino’s analog inputs 0 and 1. These measured analog voltages are then digitized and used to position each player’s paddle.
The new sketch, tv_2p_pong_potentiometers, is now available in our regular library zip, as well as on github.
Worked great! Thanks for the post.