Quick Overview:
I call this "LED Pong". I built it from scratch and I based the design on a 1-meter strip of individually addressable LEDs and an Arduino Uno. Pong was one of the first video arcade games ever made. It was released by Atari in 1972 and if you are unfamiliar with it, this video provides a good overview of the gameplay: http://www.youtube.com/watch?v=pDrRnJOCKZc

Following my design is not for the faint of heart, unless you plan to have printed circuit boards manufactured, you will need to have excellent solder skills. You will also need a lot of time, patience, and some money. This project took me about 6 months to complete (Don't worry, you can probably finish it in a couple weeks if you're motivated) and I spent about $60 on parts. However, you can modify the project to suit you needs (and save money). If you don't want all the bells and whistles, you can just omit them! In fact, this project really only needs an Arduino, two buttons, and the LED strip to work! Everything else is just extra.

I have divided this Instructable into two parts: The first part covers the building aspect and the second is an in-depth look at the software side of the project. I will do most of the in-depth explaining (I.E. How shift registers work) in Part 2. Also, I taught myself how to do most of the programming so my way may not be the best way to do something. If you know of a better way to code a function, please let me know in the comments section!

It is a good idea to test the components (LCD, LED strip, etc.) before and after you install them. To do this you will need to install the necessary libraries and then load the example from the correct library. I provide links to the libraries and tell you how to install them in step 9: "Part 2: Software".

As a last note, if you are having problems, check out step 19: "Troubleshooting, Troubleshooting, and more Troubleshooting" for some ideas on how to fix any problems. Also, be sure to frequent step 20: "Updates" for any updates/upgrades I do in the future.

Here is an index for easy navigation:

1. Operation
2. Part 1: Hardware
3. Base and LED Strip
4. Scoreboards
5. LCD
6. Arduino Shield
7. Mounting Everything to the Board
8. Buttons
9. Part 2: Software
10. Initialization/Setup
11. Main Function
12. Color Wheel Function
13. chaseForward and chaseReverse
14. player1Celebrate and player2Celebrate
15. rainbowCyclePlayer1 and rainbowCyclePlayer2
16. selectScore
17. shift1 and shift2
18. Final Notes
19. Troubleshooting, Troubleshooting, and more Troubleshooting
20. Updates

Step 1: Operation

This is a detailed explanation of how the game operates; an instruction manual, if you will. If you don't like details, or reading, or instruction manuals, skip this step.

When you first turn on LED Pong, the LCD will tell player 1 to select the winning score by pressing their button and then player 2 will confirm by pressing their button. Player 1 can then press their button and pick a score, 1 - 9, to play to. Player 2 can then confirm the winning score by pressing their button. 

Player 1 starts with the ball by default (the button LEDs indicate whose turn it is) and the game will start when they press their button. Once pressed, the 'ball' will go towards player 2. Each player is only allowed one button press when the ball is coming towards them. You can't 'spam' the button. If you press the button early, tough luck, the game will not register any more button presses until a new ball appears. The receiving player can send the ball back by pressing their button when the ball is 1 - 2 LEDs away from them (first picture).

When a player wins, a rainbow effect appears and the colors move towards the winner. The winner will start with the ball for the next game unless the game is turned off.

The potentiometer (fancy word for knob) by the scoreboard adjusts the speed of the ball. Turning it right slows the ball down and turning it left speeds it up (it is possible to return the ball on the fastest setting).
<p>Hello !</p><p>Great project :)</p><p>I'm thinking about starting it soon, however I would like to know how easy is the code to change ? </p><p>Indeed I would like to add the two following function, but I have no idea on how to do it ! </p><ol><li> if a player hits the button before the &quot;ball&quot; gets on his half, then he looses (the ball continues and the other player gets the point) <li>the more a player waits before hitting the button, the fastest the boal returns back to the other side</ol><p>Thank you very much for any help :)</p>
Thank you!<br>1. This is already implemented in the code! :)<br>2. Okay so I'm not entirely certain how to do this so you may have to play around with it a bit: Look at step 11, the variable 'val' is what sets the speed of the ball, it's mapped to the potentiometer, but you can manually set it. You could set it to a specific value in the if statements in the last half of step 11. <br>For example: 'i' determines the number of LEDs in the string so you could do some code like:<br>if (i==3) //If the led is the third from the end<br>{<br>val = val+10; //Increase the speed by 10<br>}<br>if (i == 2) //If LED ball is two from the end<br>{<br>val = val +10; //Increase the speed by another 10<br>}<br>etc...<br><br>Hope this helps!
Is there a reason behind the switch of the order of Clock and Latch between the score board shift register and those for players 1 and 2?
Nope, I got destracted and accidently soldered the latch before the clock on the scoreboard so I had to change the code haha
I see. :) <br>I noticed your project through HAD and I'm creating a proper set of PCB's for this so I can put it into a nice acrylic enclosure. PCB's also incorporate the microcontroller, so I don't have to lose a full sized Arduino board into it. <br> <br>The lack of a full schematic makes me read everything, so I noticed the switched lines.
Oh sweet, shoot me a message when you complete it, i'd be interested in seeing how it turns out.<br><br>Haha I thought about adding a full schem but then realized the picture would look really zoomed out because there are so many components.

About This Instructable




Bio: Working with electricity has been my hobby since I was 8 or 9. I have always loved to take stuff apart and redesign it in ... More »
More by Chip Fixes:LED Pong Creative Valentines Gift How to Build a Slayer Exciter 
Add instructable to: