Introduction: Arduino Pong
In this Instructable, I will be teaching you how to recreate the popular arcade game Pong, on your Arduino.
Step 1: Step 1: Materials
To make the Arduino Pong you will need:
1. Arduino Uno (or any other Arduino board)
2. Jumper Cables
3. 470 Ohm resistor x1
4. 1k Ohm resistor x1
5. Alligator Clips (If you don't want to do a lot of soldering)
6. 10k Ohm Potentiometer
7. RCA Cable
Other Materials:
1. Breadboard
2. Soldering Iron
3. Solder Wire
4. Solder flux
5. Electrical tape
Step 2: Step 2: Getting the RCA Ready
First, cut off one end of your RCA Cable, and strip away the shielding. Inside the shielding, there should be two separate cables. The cable with the additional shielding on it is your signal line, while the other one goes to ground.
Step 3: Step 3: Connecting Your RCA to the Arduino
Solder the 470 and 1 K Ohm resistors to the signal line
The 470 Ohm resistor should slot into IO pin D07, while the 1 K Ohm resistor should slot into pin D09. The ground cable on the RCA should slot into one of the GND pins. I soldered a jumper cable to my ground cable so I can slot it in the GND pin easily.
Step 4: Step 4: Wiring the Potentiometers -> Signal
The 'pots' will have 3 pins, of which the middle one (most of the time) is the signal line. The two other pins are for power and ground, you can use them interchangeably.
I used alligator clips and a breadboard for this section, because soldering all the wires together would become quite messy, and I wanted to take this project apart afterwards anyway.
Attach your alligator clips to each of the pins, and add jumper cables to them.
Then, connect the middle cable of one of your pots to Analog Input pin A0, and the middle cable of the other to pin A1.
Step 5: Step 5: Wiring the Potentiometers -> Power
Now, connect the jumper cables from the side pins on each pot to the breadboard, and then to the 5V pin as shown in the picture
Step 6: Step 6: Wiring the Potentiometers -> Ground
Next, wire the remaining pins on the pots to the breadboard, and then to the GND pin on the Arduino as shown in the picture
Step 7: Step 7: Finishing Up the Controller
Add the RCA plug to the board and your finished controller should look something like this. I'v wired the input cables through the breadboard in the picture only for a more neat looking design
Step 8: Step 8: Code
Cope-paste this code for the Pong game. This code was originally written by Lamonica, and edited by duboisvb for two players. Note that the code has sound output as well, but since I didn't have any more RCA plugs lying around, I didn't add it. If you do have extra RCA cables, then wire the signal cable directly to pin D11.
Plug the RCA into your TV and you can start playing !