loading
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 .

Step 1: Video of the Game

 

Step 2: 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

Step 3: 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. 

Step 4: 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.

Step 5: 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

Step 6: 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

Step 7: 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.


Step 8: 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.

Step 9: 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.
Hey awesome work... I would definitely try that out soon<br><br>Please have a look at this instructable as well <br>https://www.instructables.com/id/Led-Cube-3x3x3-1/
<p>Thank you so much! I love the pong game. I have an arduino nano and a arduino uno. I am going to upload the program to both and combine both wiring onto the breadboard so that the tv screen will have better contrast! Keep up the Good work! Have a good day.</p>
I love this project. Everything works great, except when I run the code, it redraws everything every frame. So it looks like the tv is almost strobing. I can't find a way to fix this. I tried adding another resistor but it didn't help the flickering. Any suggestions on a fix?
<p>RE: FLICKERING. BAD REFRESH. PADDLE ANNOYING. BACKGROUND</p><p>The flickering occurs when background refreshes the background but paddles are not displayed (thus they dissapear until they are displayed). To fix this, only refresh the screen when you are ready to update the paddle positions:</p><p> background(50); //Delete &quot;background&quot; from draw() and paste inside serialEvent</p><p> leftPaddle.display(lpp);</p><p> rightPaddle.display(rpp);</p>
<p>I made it too, starting from Pete Lamonica code. My video is here:</p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/1yN-gk0nHsM" width="500"></iframe></p><p>I have then re-written a complete new color version for VGA output. Video here: </p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/hVzA3x4EiT4" width="500"></iframe></p><p>Following the video description, you can find the istuction to reproduce it! </p>
<p>this was a pretty easy sketch to load and test. i used a parallax joystick to represent player 1 and player 2. as soon as the arduino loaded the sketch it went right into the game. no pause to hit any button. there was no way to pause/end the game without powering down the arduino. i also experienced flickering and couldnt resolve with the added resistor. </p><p>I also tried robmawe91 rewritten sketch but when it loaded the screen went haywire and i powered arduino off.</p>
<p>dont you have another diagram?</p>
<p>:)</p>
<p>Nice project, But I had to rewrite the program...</p><p>//Arduino Tv framebuffer<br>//Alastair Parker<br>//2007<br><br>// Video out voltage levels<br>#define _SYNC 0x00<br>#define _BLACK 0x01<br>#define _GRAY 0x02<br>#define _WHITE 0x03<br><br>// dimensions of the screen<br>#define WIDTH 38<br>#define HEIGHT 14<br><br>//number of lines to display<br>#define DISPLAY_LINES 240<br><br>// update speed for the main loop of the game<br>#define UPDATE_INTERVAL 1<br><br>// positions of the player paddles<br>#define PLAYER_RIGHT_X 35<br>#define PLAYER_LEFT_X 2<br><br>// maximum velocity of the ball<br>#define MAX_VEL 10<br><br>// locations of the top and bottom virtual bars<br>#define SCORE_BAR 3<br>#define BASE_BAR 13<br><br>// time to wait while paused<br>#define DONE_WAITING 30<br>#define SCORE_WAITING 30<br><br>// max player life<br>#define MAX_LIFE 6<br><br>//positions of player life bars<br>#define PLAYER_LEFT_LIFE 2<br>#define PLAYER_RIGHT_LIFE 23<br><br>// input pins for the player pots<br>#define PLAYER_LEFT_PIN 2<br>// currently the same pin<br>#define PLAYER_RIGHT_PIN 1<br><br>//video pins<br>#define DATA_PIN 9<br>#define SYNC_PIN 8<br><br>// the video frameBuffer<br>byte frameBuffer[WIDTH][HEIGHT];<br><br>// loop indices<br>byte index, index2;<br><br>// pal video line loop<br>byte line;<br>// current drawing line in framebuffer<br>byte newLine;<br><br>// flag used in wait loop to indicate that player just scored<br>boolean justScored=false;<br><br>// positions for the left paddle<br>byte playerLeft;<br>byte playerLeftOld=-1;<br>// life for the left player<br>byte playerLeftLife = MAX_LIFE;<br><br>// positions of the right paddle<br>byte playerRight;<br>byte playerRightOld=-1;<br>// life for the right player<br>byte playerRightLife = MAX_LIFE;<br><br>// positions and velocity of the ball<br>int ballXVel = -1;<br>int ballYVel = -5;<br>byte ballXPos = 14;<br>byte ballYPos = 7;<br><br>// loop counters to control the velocity of the ball<br>byte ballXLoop =MAX_VEL;<br>byte ballYLoop =MAX_VEL;<br><br>// loop counter to for the main loop delay <br>int waitingCount = 0;<br><br>// start postion of the loading bar<br>byte loadingBar = 2;<br><br>// if the left player should be updated or the right<br>boolean playerLeftTurn=true;<br><br>// if we should be waiting for something to happen<br>boolean waiting=true;<br>// if displaying the title<br>boolean showingTitle = true;<br><br>// value of the counter controlling the freq of updates<br>byte updateCounter=0;<br><br>// init the variables<br>void initGame()<br>{<br> playerLeftOld=-1;<br> playerLeftLife = MAX_LIFE;<br> playerRightOld=-1;<br> playerRightLife = MAX_LIFE;<br> ballXVel = -1;<br> ballYVel = -5;<br> ballXPos = 14;<br> ballYPos = 7;<br> ballXLoop =MAX_VEL;<br> ballYLoop =MAX_VEL;<br> waitingCount = 0;<br> loadingBar = 2;<br> playerLeftTurn=true;<br> waiting=true;<br> showingTitle = true;<br> justScored=false;<br> updateCounter=0;<br>}<br><br>// draw a pixel to the buffer<br>void setPixel(byte x,byte y)<br>{<br> frameBuffer[x][y]= _WHITE;<br>}<br><br>void grayPixel(byte x, byte y)<br>{<br> frameBuffer[x][y]= _GRAY;<br>}<br><br>// draw a black pixel to the buffer<br>void clearPixel(byte x,byte y)<br>{<br> frameBuffer[x][y]= _BLACK;<br>}<br><br>// draw a paddle<br>void drawPaddle(byte x,byte y,byte col)<br>{<br> frameBuffer[x][y]= col;<br> frameBuffer[x][y+1]= col;<br>}<br><br><br>//draw the title message<br>void drawArduinoPong()<br>{<br> //arduino<br> setPixel(7,3);<br> setPixel(8,3);<br> setPixel(15,3);<br> setPixel(21,3);<br> setPixel(6,4);<br> setPixel(8,4);<br> setPixel(14,4);<br> setPixel(15,4);<br> setPixel(28,4);<br> setPixel(6,5);<br> setPixel(7,5);<br> setPixel(8,5);<br> setPixel(10,5);<br> setPixel(11,5);<br> setPixel(13,5);<br> setPixel(15,5);<br> setPixel(17,5);<br> setPixel(19,5);<br> setPixel(21,5);<br> setPixel(23,5);<br> setPixel(24,5);<br> setPixel(27,5);<br> setPixel(29,5);<br> setPixel(6,6);<br> setPixel(8,6);<br> setPixel(10,6);<br> setPixel(14,6);<br> setPixel(15,6);<br> setPixel(18,6);<br> setPixel(19,6);<br> setPixel(21,6);<br> setPixel(23,6);<br> setPixel(25,6);<br> setPixel(28,6);<br><br> //pong<br> setPixel(10,8);<br> setPixel(11,8);<br> setPixel(15,8);<br> setPixel(16,8);<br> setPixel(19,8);<br> setPixel(22,8);<br> setPixel(24,8);<br> setPixel(25,8);<br> setPixel(26,8);<br> setPixel(10,9);<br> setPixel(12,9);<br> setPixel(14,9);<br> setPixel(17,9);<br> setPixel(19,9);<br> setPixel(20,9);<br> setPixel(22,9);<br> setPixel(24,9);<br> setPixel(10,10);<br> setPixel(11,10);<br> setPixel(14,10);<br> setPixel(17,10);<br> setPixel(19,10);<br> setPixel(21,10);<br> setPixel(22,10);<br> setPixel(24,10);<br> setPixel(26,10);<br> setPixel(10,11);<br> setPixel(15,11);<br> setPixel(16,11);<br> setPixel(19,11);<br> setPixel(22,11);<br> setPixel(24,11);<br> setPixel(25,11);<br> setPixel(26,11);<br>}<br>// do the main game logic regarding the ball and collisions<br>void updateBall(boolean xEvent)<br>{<br> // if checking the x coords of the ball<br> if(xEvent)<br> {<br> /*<br> TODO<br> <br> have the yvel start 1t 1<br> <br> */<br> <br> //check for collision with left player<br> if(ballXPos &lt;PLAYER_LEFT_X+2 &amp; (playerLeft == ballYPos or playerLeft+1 == ballYPos))<br> {<br> ballXVel = -1 * ballXVel;<br> ballXPos=PLAYER_LEFT_X+1;<br> }<br> //check for collision with right player<br> if(ballXPos &gt; PLAYER_RIGHT_X-2 &amp; (playerRight == ballYPos or playerRight+1 == ballYPos))<br> {<br> ballXVel = -1 * ballXVel;<br> ballXPos=PLAYER_RIGHT_X-1;<br> }<br> <br> //move the ball in the x direction<br> if(ballXVel &lt; 1)<br> {<br> ballXPos--;<br> }<br> else<br> {<br> ballXPos++;<br> }<br> }<br> <br> //if checking the y coords<br> if(!xEvent)<br> {<br> //check for top of screen hit<br> if( ballYPos &lt;= SCORE_BAR )<br> {<br> ballYVel = -1 * ballYVel; <br> ballYPos = SCORE_BAR;<br> }<br> //check for bottom of screen hit<br> if( ballYPos&gt;BASE_BAR )<br> {<br> ballYVel = -1 * ballYVel; <br> ballYPos = BASE_BAR+1;<br> }<br> <br> // move the ball in the y direction<br> if(ballYVel &lt; 1)<br> {<br> ballYPos--;<br> }<br> else<br> {<br> ballYPos++;<br> } <br> }<br> <br> //always check for scoring of points<br> <br> //right player scores<br> if(ballXPos==PLAYER_LEFT_X)//0<br> {<br> //reset the position of the ball<br> ballXPos = PLAYER_RIGHT_X - 5;<br> ballYPos=7;<br> <br> // change the other players life<br> clearPixel(PLAYER_LEFT_LIFE+2*playerLeftLife-2,SCORE_BAR-1);<br> playerLeftLife--;<br> <br> // indicate that someone scored so the wait doesn't start a new game<br> justScored=true;<br> // indicate that we should wait next loop<br> waiting=true;<br><br> // check if game is over<br> if(playerLeftLife==0)<br> justScored=false; <br> }<br> <br> //left player scores<br> if(ballXPos==PLAYER_RIGHT_X)//38<br> {<br> //reset position of ball<br> ballXPos = PLAYER_LEFT_X + 5;<br> ballYPos=7;<br> <br> //update other players score<br> clearPixel(PLAYER_RIGHT_LIFE+2*(MAX_LIFE-playerRightLife)+2,SCORE_BAR-1);<br> playerRightLife--;<br> <br> // indicate that someone scored so the wain doesn't start a new game<br> justScored=true;<br> // indicate that we should wait next loop<br> waiting=true;<br><br> // check for game over<br> if(playerRightLife==0)<br> justScored=false;<br> }<br> <br>}<br><br>// draw the player life bars<br>void initScreen()<br>{<br> for(index=1;index&lt;=MAX_LIFE;++index)<br> {<br> grayPixel(index*2,SCORE_BAR-1);<br> grayPixel(index*2+PLAYER_RIGHT_LIFE,SCORE_BAR-1);<br> }<br>}<br><br><br>// draw the ball<br>void drawBall(byte col)<br>{<br> frameBuffer[ballXPos][ballYPos]=col; <br>}<br><br>// clear the screen<br>void clearScreen()<br>{<br> for (index = 0; index &lt; WIDTH; index++)<br> for (index2=0;index2&lt;=HEIGHT;++index2)<br> {<br> frameBuffer[index][index2] = _BLACK;<br> } <br>}<br><br>// the setup routine<br>void setup()<br>{<br> cli();<br> pinMode (SYNC_PIN, OUTPUT);<br> pinMode (DATA_PIN, OUTPUT);<br> digitalWrite (SYNC_PIN, HIGH);<br> digitalWrite (DATA_PIN, HIGH);<br> clearScreen();<br> drawArduinoPong();<br>}<br><br>void loop()<br>{<br> // iterate over the lines on the tv<br> for ( line =0;line&lt; DISPLAY_LINES;++line)<br> {<br> <br> // HSync<br> // front porch (1.5 us)<br> PORTB = _BLACK;<br> delayMicroseconds(1.5);<br> //sync (4.7 us)<br> PORTB = _SYNC;<br> delayMicroseconds(4.7);<br> // breezeway (.6us) + burst (2.5us) + colour back borch (1.6 us)<br> PORTB = _BLACK;<br> delayMicroseconds(0.6+2.5+1.6);<br><br><br> //calculate which line to draw to<br> newLine = line &gt;&gt;4;<br> delayMicroseconds(1); <br> <br> //display the array for this line<br> // a loop would have been smaller, but it messes the timing up<br> PORTB = frameBuffer[0][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[1][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[2][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[3][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[4][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[5][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[6][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[7][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[8][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[9][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[10][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[11][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[12][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[13][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[14][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[15][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[16][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[17][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[18][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[19][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[20][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[21][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[22][newLine];<br> delayMicroseconds(1); <br> PORTB = frameBuffer[23][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[24][newLine];<br> delayMicroseconds(1); <br> PORTB = frameBuffer[25][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[26][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[27][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[28][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[29][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[30][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[31][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[32][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[33][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[34][newLine];<br> delayMicroseconds(1);<br> PORTB = frameBuffer[35][newLine];<br> delayMicroseconds(1);<br> <br> // klugdge to correct timings<br> PORTB = frameBuffer[36][newLine]; <br> PORTB=PORTB;<br> PORTB=PORTB;<br> PORTB=PORTB;<br> delayMicroseconds(3);<br> }<br> <br> <br> //vsync <br> PORTB = _SYNC;<br><br> // if delaying for some reason<br> if(waiting)<br> {<br> // increment the waiting counter<br> waitingCount++;<br> <br> // if waiting is over for a new game<br> if(waitingCount==DONE_WAITING &amp; !justScored)<br> {<br> waitingCount=0;<br> // if on title screen<br> if(showingTitle)<br> {<br> // draw the loading bar<br> grayPixel(loadingBar,BASE_BAR);<br> loadingBar+=2;<br> <br> // done loading<br> if (loadingBar &gt; 37)<br> {<br> showingTitle=false;<br> clearScreen(); <br> initGame();<br> initScreen();<br> waiting=false;<br> }<br> }<br> }<br> <br> // waiting because someone scored<br> if(waitingCount==SCORE_WAITING &amp; justScored)<br> {<br> justScored=false; <br> waitingCount=0;<br> waiting=false;<br> }<br> // wait for the remainder of the sync period<br> delayMicroseconds(305);<br> }<br> // not waiting<br> else<br> {<br> // increment the update delay counter<br> updateCounter++;<br> if( updateCounter &gt;= UPDATE_INTERVAL)<br> {<br> //player movement<br> if(playerLeftTurn)<br> {<br> drawPaddle(PLAYER_LEFT_X,playerLeftOld,_BLACK);<br> playerLeft = analogRead(PLAYER_LEFT_PIN)&gt;&gt;6;<br> if(playerLeft&lt;SCORE_BAR)<br> playerLeft=SCORE_BAR;<br> if(playerLeft&gt;BASE_BAR)<br> playerLeft=BASE_BAR;<br> drawPaddle(PLAYER_LEFT_X,playerLeft,_WHITE);<br> playerLeftOld=playerLeft;<br> playerLeftTurn=false;<br> }<br> else<br> {<br> drawPaddle(PLAYER_RIGHT_X,playerRightOld,_BLACK);<br> playerRight = analogRead(PLAYER_RIGHT_PIN)&gt;&gt;6;<br> if(playerRight&lt;SCORE_BAR)<br> playerRight=SCORE_BAR;<br> if(playerRight&gt;BASE_BAR)<br> playerRight=BASE_BAR;<br> drawPaddle(PLAYER_RIGHT_X,playerRight,_WHITE);<br> playerRightOld=playerRight; <br> playerLeftTurn=true;<br> }<br> // remainder of sync period<br> delayMicroseconds(10); <br> updateCounter=0;<br> }<br> else<br> // remainder of sync period<br> delayMicroseconds(250); <br><br> // perform ball x velocity delay<br> ballXLoop--;<br> if(ballXLoop &lt;= abs(ballXVel) and ballXVel != 0)<br> {<br> //ball movement;<br> drawBall(_BLACK);<br> updateBall(true);<br> ballXLoop=MAX_VEL;<br> }<br> <br> // perform ball y velocity delay <br> ballYLoop--;<br> if(ballYLoop &lt;= abs(ballYVel) and ballYVel != 0)<br> {<br> //ball movement;<br> drawBall(_BLACK);<br> updateBall(false);<br> ballYLoop=MAX_VEL;<br> }<br> // draw new ball<br> drawBall(_GRAY); <br> }<br>}</p><p>If any one can help me get the sound to work please help me!!!</p>
Nice Proyect !!!!
Hi i have a question, When I plug the game in everything works fine exept for that the game starts without me pressing the button. then i cant controll the game with the paddles they just stand there and jump up and down a little. have anyone had the same problem and what can i do to fix it. <br>ps there is nothing wrong with the paddles ds
hello, <br>Usually when I have had problems with the electronics not working exactly correct, it turns out to be something with the grounds. Admittedly this is a pretty non specific answer but maybe someone else can help. I usually just do a lot of trial and error .
I have the same issue <br>
so... as a beginner it was difficult to recognize the problem with the compiling. <br>Took me half an hour to find out that I need to download the TVout library from here: <br>http://code.google.com/p/arduino-tvout/downloads/detail?name=TVout_w_audio.zip&amp;can=2&amp;q= <br>and add it to the arduino libraries. <br>eventualy I restarted the program and pasted the code and it compiled! <br> <br>It will take some time till my first arduino comes. Till then i'm planing to do start screen and to chose if I want to play single or multiplayer. <br> <br>Thank you for your guide!!! :)
hi id like to say great instructable! i got my first arduino today and have made this one problem im having is i get an load of errors while trying to compile, im quiet new to this so maybe nothing much these are the erros im getting i would be very greatful for your advice thanks in advance.<br><br><br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:27: error: prototype for 'void TVout::select_font(const unsigned char*)' does not match any in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\/TVout.h:103: error: candidate is: void TVout::select_font(uint8_t)<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:35: error: prototype for 'void TVout::print_char(uint8_t, uint8_t, unsigned char)' does not match any in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\/TVout.h:104: error: candidate is: void TVout::print_char(uint8_t, uint8_t, char)<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:41: error: no 'void TVout::inc_txtline()' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:49: error: no 'void TVout::write(const char*)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:56: error: no 'void TVout::write(const uint8_t*, uint8_t)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:62: error: no 'void TVout::write(uint8_t)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:92: error: no 'void TVout::print(const char*)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:97: error: no 'void TVout::print(char, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:102: error: no 'void TVout::print(unsigned char, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:107: error: no 'void TVout::print(int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:112: error: no 'void TVout::print(unsigned int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:117: error: no 'void TVout::print(long int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:132: error: no 'void TVout::print(long unsigned int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:138: error: no 'void TVout::print(double, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:143: error: no 'void TVout::println()' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:149: error: no 'void TVout::println(const char*)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:155: error: no 'void TVout::println(char, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:161: error: no 'void TVout::println(unsigned char, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:167: error: no 'void TVout::println(int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:173: error: no 'void TVout::println(unsigned int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:179: error: no 'void TVout::println(long int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:185: error: no 'void TVout::println(long unsigned int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:191: error: no 'void TVout::println(double, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:197: error: no 'void TVout::printPGM(const char*)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:205: error: no 'void TVout::printPGM(uint8_t, uint8_t, const char*)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:215: error: no 'void TVout::set_cursor(uint8_t, uint8_t)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:220: error: no 'void TVout::print(uint8_t, uint8_t, const char*)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:226: error: no 'void TVout::print(uint8_t, uint8_t, char, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:231: error: no 'void TVout::print(uint8_t, uint8_t, unsigned char, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:236: error: no 'void TVout::print(uint8_t, uint8_t, int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:241: error: no 'void TVout::print(uint8_t, uint8_t, unsigned int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:246: error: no 'void TVout::print(uint8_t, uint8_t, long int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:251: error: no 'void TVout::print(uint8_t, uint8_t, long unsigned int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:256: error: no 'void TVout::print(uint8_t, uint8_t, double, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:262: error: no 'void TVout::println(uint8_t, uint8_t, const char*)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:270: error: no 'void TVout::println(uint8_t, uint8_t, char, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:278: error: no 'void TVout::println(uint8_t, uint8_t, unsigned char, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:286: error: no 'void TVout::println(uint8_t, uint8_t, int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:294: error: no 'void TVout::println(uint8_t, uint8_t, unsigned int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:302: error: no 'void TVout::println(uint8_t, uint8_t, long int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:310: error: no 'void TVout::println(uint8_t, uint8_t, long unsigned int, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:318: error: no 'void TVout::println(uint8_t, uint8_t, double, int)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:326: error: no 'void TVout::printNumber(long unsigned int, uint8_t)' member function declared in class 'TVout'<br>C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:347: error: no 'void TVout::printFloat(double, uint8_t)' member function declared in class 'TVout'<br>
Hello,<br>Well, let me say that I am fairly new to the arduino programming also. But I have struggled through several programs .<br><br>I just took the code from the Instructable and copied and pasted it into a new sketch and it verified ok. Just wanted to check that I copied it to the instructable ok. So I can say the code is at least compilable.<br><br>What I do notice is:<br><br>All the lines that reference a font are not compiling. <br>for example : TV.select_font(_8X8);<br><br>I have had some trouble in the past when copying and pasting with special characters like the underscore. Sometimes it looks ok but the compiler interprets it as something different. <br><br>I might try to retype that line and see if it gets by the compiler. <br><br>Also, lines without ; or not using capital letters if they are required are possible problems.<br><br>Keep me posted<br>
ok so before i was using arduino 0022 if i put the code into 0021 then i only get these error codes <br><br><br>sketch_mar31a.cpp:10:21: error: TVout.h: No such file or directory<br>sketch_mar31a:38: error: 'TVout' does not name a type<br>sketch_mar31a.cpp: In function 'void drawGameScreen()':<br>sketch_mar31a:90: error: 'TV' was not declared in this scope<br>sketch_mar31a.cpp: In function 'void drawBox()':<br>sketch_mar31a:132: error: 'TV' was not declared in this scope<br>sketch_mar31a.cpp: In function 'void drawMenu()':<br>sketch_mar31a:154: error: 'TV' was not declared in this scope<br>sketch_mar31a:155: error: '_8X8' was not declared in this scope<br>sketch_mar31a:157: error: '_5X7' was not declared in this scope<br>sketch_mar31a.cpp: In function 'void setup()':<br>sketch_mar31a:198: error: 'TV' was not declared in this scope<br>sketch_mar31a:198: error: '_NTSC' was not declared in this scope<br>sketch_mar31a.cpp: In function 'void loop()':<br>sketch_mar31a:225: error: 'TV' was not declared in this scope<br>sketch_mar31a:236: error: 'TV' was not declared in this scope<br>sketch_mar31a:240: error: 'TV' was not declared in this scope<br>sketch_mar31a:256: error: 'TV' was not declared in this scope<br>sketch_mar31a:258: error: 'TV' was not declared in this scope<br>sketch_mar31a:274: error: 'TV' was not declared in this scope<br>sketch_mar31a:274: error: '_8X8' was not declared in this scope<br>sketch_mar31a:281: error: '_5X7' was not declared in this scope<br>sketch_mar31a:289: error: 'TV' was not declared in this scope<br><br>hmmm im struggling here all part of the learning curve i guess :-)
I am using 0021. It would appear that the TVout library is not in your enviroment. When you open an Arduino sketch click &quot;Sketch&quot; and select &quot;import library&quot;. Does TVout show as an option? If not , something is wrong with where it is located . Maybe try finding it and see if you can move the folder to where the other librarys are.
thank you for your help i got it to compile using an older version of tvout and the 0021 when connected to the tv and running i only get a white screen that flickers with black lines cud this be because im using pal tv or could there be something wrong with my wiring? i no im so close to it running right lol ;-)
when you go into the compiler and paste the code in, you should scroll down until you se a blue (_NTSC) then change it to (_PAL) <br>hope this works :), worked for me, but the image was slightly on an angle and scrolling downn :( <br>trying to fix it
need the resistors
Well, not sure what that could be but this web site indicates PAL is ok .<br>http://code.google.com/p/arduino-tvout/<br><br> And if you click on &quot;wiki&quot; there are some sample sketches that may help isolate the issue. There are other sites and discussions too. I had some flickering and actually ended up with a little. I did have to check the wiring several times also. In my instructable there are links to the original posters of this project(though a little different). There are a lot of comments from users . Maybe there is one that addresses your problem.<br><br>
the code is for NTSC you need to chande it. <br>see my comment above for details
This is where my libraries are located;<br><br><br> My Documents\Downloads\arduino-0021\arduino-0021\libraries
Great ible! What if I modded this for a cartridge slot and was able to make a monochrome game system? Very low performance, I know, but it's a start!
can yo make it single player? <br>
if you go back to the Instructable from Kyle Brinkerhoff, you will see that his is for one player. I modified his to include 2 players . So you would just need to review the original Instructable to see the differences. Hope that helps.
cool thanks :)
Is there a way to make the controllers from pots?
I believe you could do that. the code is just reading an analog input so a pot should work fine.
Thanks, so I coonnect the center of the pot to analog in and the two outer two to GND and 5V?
that should work, but i would try first with 3v out just in case
pong is the best whoooooooooooooooooooooooooooooooooo!!!!!!!!!!!!!!!!!!!
i have a question from where did you get the TV out H file<br>i mean the librarie you include in the beginning of the code<br>thx great project<br>
I got it here. Though there appears to be a newer version now.<br><br>http://code.google.com/p/arduino-tvout/downloads/detail?name=TVout_w_audio.zip&amp;can=2&amp;q=
To make things faster ball wise, would i increase the max y velocity in the code? <br>
Not exactly. Max y velocity is a limit to the y speed . The y speed is incremented in <br>the line;<br><br>ballVolY += 2 * ((ballY - leftPaddleY) - (PADDLE_HEIGHT / 2)) / (PADDLE_HEIGHT / 2);<br><br>and then it is tested against Max Y velocity in these lines:<br><br>//limit vertical speed<br> if(ballVolY &gt; MAX_Y_VELOCITY) ballVolY = MAX_Y_VELOCITY;<br> if(ballVolY &lt; -MAX_Y_VELOCITY) ballVolY = -MAX_Y_VELOCITY;<br><br>so there will be an increment in speed and it will be limited by Max y Velocity<br><br><br>However I found the overall speed can be greatly influenced by this line:<br><br> if(frame % 3 == 0) { //every third frame<br><br>if you change 3 to other numbers you can speed it up or slow it down greatly. Atleast that is what I found.<br>Hope that helps. <br><br>
Thanks. I'll see what i can do.
Love it

About This Instructable

41,197views

60favorites

License:

Bio: Retired Math teacher who needs a hobby! So I tinker with stuff: Arduino, welding, my 1958 TR-3 , my tennis serve
More by duboisvb:Pizza Rat POV Clock & Message display w/RTC and PS/2 Keyboard Purple Rotary Phone 
Add instructable to: