2 Player Pong Using Arduino
I started with the Instructable from Kyle Brinckerhoff;
https://www.instructables.com/id/Ardu-pong-the-Arduino-based-pong-console/
Thanks Kyle!
and the following at Make magazine
http://blog.makezine.com/archive/2007/08/arduino-pong.html
and I see the original code is attributed to Pete Lamonica
Thanks Pete!!
I am using the paddles instead of the joy stick and I have made it for 2 players. Also I added some sound.
I put the electronics in an Iphone box .
https://www.instructables.com/id/Ardu-pong-the-Arduino-based-pong-console/
Thanks Kyle!
and the following at Make magazine
http://blog.makezine.com/archive/2007/08/arduino-pong.html
and I see the original code is attributed to Pete Lamonica
Thanks Pete!!
I am using the paddles instead of the joy stick and I have made it for 2 players. Also I added some sound.
I put the electronics in an Iphone box .
Video of the Game
What I Used
I used the following:
Iphone box
Arduino - I had a Freeduino from Solarbotics that I used. The picture shows another but I am sure others would work fine.
Atari paddles - I had from an old system being stored in the basement. I see them on eBay.
An old RCA cord that was in my big box of misc cords
A 9 pin D connector that I got at Radio Shack - pn 276-1538
Also (not shown)
RCA plugs for the cable to attach to - had in my pile of broken things
resistors
75 ohm
1Kohm
330 ohm
2 10k ohm pull down resistors
Some misc hardware - wire, screws,small pieces of wood
Iphone box
Arduino - I had a Freeduino from Solarbotics that I used. The picture shows another but I am sure others would work fine.
Atari paddles - I had from an old system being stored in the basement. I see them on eBay.
An old RCA cord that was in my big box of misc cords
A 9 pin D connector that I got at Radio Shack - pn 276-1538
Also (not shown)
RCA plugs for the cable to attach to - had in my pile of broken things
resistors
75 ohm
1Kohm
330 ohm
2 10k ohm pull down resistors
Some misc hardware - wire, screws,small pieces of wood
Prepare the Box
I started with a small piece of wood which I cut to fit inside the box. The idea was I would secure everything to this piece and then secure the box to the wood. Holes need to be cut to fit the RCA plugs, the 9 pin connector, and for a USB cable which is needed to attach to Arduino .
I glued another small piece of wood to the larger to be used as a place to secure the Arduino.
Electronics Part1 - the RCA Plugs
Following the instructions from Kyle's Instructable, I soldier a 1k ohm and a 330 ohm resistor to the center pin of the video out RCA jack.
I also connected the 75 ohm that is shown in the diagram . It made the picture a little less bright but much clearer and it stopped a lot of the flickering.
The RCA plug for the sound is straight forward: The center plug goes to Arduino pin 11 and the ground side goes to ground.
The bottom part of the diagram is different than what I did.
I also connected the 75 ohm that is shown in the diagram . It made the picture a little less bright but much clearer and it stopped a lot of the flickering.
The RCA plug for the sound is straight forward: The center plug goes to Arduino pin 11 and the ground side goes to ground.
The bottom part of the diagram is different than what I did.
Electronics Part2 - Connections to Arduino
Basically
Analog pin 1 - goes to paddle 1
Analog pin 2 - goes to paddle 2
Ground - used to ground the 9 pin connector, the RCA connectors
5v goes to the 5 v on the 9 pin connector
Digital pin2 - goes to the button on Paddle 1(button on paddle 2 is not used)
Digital 8 - goes to video RCA
Digital 9 - goes to video RCA
Digital 11 - goes to sound RCA
Analog pin 1 - goes to paddle 1
Analog pin 2 - goes to paddle 2
Ground - used to ground the 9 pin connector, the RCA connectors
5v goes to the 5 v on the 9 pin connector
Digital pin2 - goes to the button on Paddle 1(button on paddle 2 is not used)
Digital 8 - goes to video RCA
Digital 9 - goes to video RCA
Digital 11 - goes to sound RCA
Electronics Part3 - the 9 Pin Connector
Struggled with this but more through trial and error than anything else, I got to the following:
Looking at the pins from the back of the connector:
The top row (left to right)
pin1 - goes to analog 0
pin 2 - not used
pin 3 - goes to Digital 2 - the button
pin 4 & pin 5 - not used
bottom row(left to right)
pin 6 - goes to analog 1
pin 7 - goes to ground
pin 8 - goes to 5 v
pin 9 - not used
Looking at the pins from the back of the connector:
The top row (left to right)
pin1 - goes to analog 0
pin 2 - not used
pin 3 - goes to Digital 2 - the button
pin 4 & pin 5 - not used
bottom row(left to right)
pin 6 - goes to analog 1
pin 7 - goes to ground
pin 8 - goes to 5 v
pin 9 - not used
The Code
The code I used is in the text file below.
Early testing was done on the Mickey Mouse TV .
But it works ok on large TV as shown in step 1.
Early testing was done on the Mickey Mouse TV .
But it works ok on large TV as shown in step 1.
Downloads
Stuff It in Box
After some testing, I placed everything into the Iphone box and secured it.
I also added a switch to turn the battery power on/off.
Hook It Up
Connect the RCA cable to the jacks, the Paddles to the 9 pin connector, switch on TV and power to Arduino and play.