Here's a simple project that you can do to get acquainted with the TVOut Library, and using an Arduino with RCA Jack outputs! Pong is a classic. The foundations of video gaming start with two lines and a dot bouncing back and forth on a black screen. The Atmega328 is leaps and bounds more powerful than the original pong system (which was either quite a lot of transistors, or a chip with less power than a dollar store calculator), and we'll have no problem making a pong clone with Arduino. If you want to make your own game with Arduino, this is a cool place to start. Let's make Pong!
Step 1: Project Parts Note
You can build this with different parts, these are just the suggested ones for simplicity. Don't skip the Sensor Shield, it will save you loads of time, allowing you to skip bread-boarding entirely. Our wiring diagram will assume you're using the sensor shield. If you don't want sound, you can skip the Y cable and 2 of the RCA boards.
Step 2: Wiring
Follow the diagram to make your TVOut Console. Watch your jumpers, make sure they're set to 5V or you could destroy not only the RCA boards, but the input on your television.
Step 3: Programming
Grab the RobotGeek Libraries and Tools from Github, and extract it to your Arduino folder.
File → Examples → TVOut → PongNTSC
and upload it to your aArduino.
You're ready to play some pong! This program utilizes the TVout library, which handles drawing shapes, text, and bitmaps to the screen. It is a completely interrupt driven library that will output either NTSC or PAL composite. Pong isn't the only game designed using the TVout library! If you check out Nootropic Design, there are a good handful of games made, and they have a section devoted to helping you design your own! This makes for some great jumping off points on an adventure into making your own video games!
Step 4: Play!
So you might notice that the game isn't particularly challenging. Can you find out where the ball speed is in the code? What would happen if you changed the paddle size? Those sounds are kind of annoying, and there's no music. Could you use the TV.tone function to change that? What about changing the message that appears on screen at game over? Play around with the code and see what you can make happen!