http://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 .
Remove these ads by
Signing UpStep 1Video of the game
| « Previous Step | Download PDFView All Steps | Next Step » |















































i mean the librarie you include in the beginning of the code
thx great project
http://code.google.com/p/arduino-tvout/downloads/detail?name=TVout_w_audio.zip&can=2&q=
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'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\/TVout.h:103: error: candidate is: void TVout::select_font(uint8_t)
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'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\/TVout.h:104: error: candidate is: void TVout::print_char(uint8_t, uint8_t, char)
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:41: error: no 'void TVout::inc_txtline()' member function declared in class 'TVout'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:49: error: no 'void TVout::write(const char*)' member function declared in class 'TVout'
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'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:62: error: no 'void TVout::write(uint8_t)' member function declared in class 'TVout'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:92: error: no 'void TVout::print(const char*)' member function declared in class 'TVout'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:97: error: no 'void TVout::print(char, int)' member function declared in class 'TVout'
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'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:107: error: no 'void TVout::print(int, int)' member function declared in class 'TVout'
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'
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'
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'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:138: error: no 'void TVout::print(double, int)' member function declared in class 'TVout'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:143: error: no 'void TVout::println()' member function declared in class 'TVout'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:149: error: no 'void TVout::println(const char*)' member function declared in class 'TVout'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:155: error: no 'void TVout::println(char, int)' member function declared in class 'TVout'
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'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:167: error: no 'void TVout::println(int, int)' member function declared in class 'TVout'
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'
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'
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'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:191: error: no 'void TVout::println(double, int)' member function declared in class 'TVout'
C:\Users\stiv\Desktop\arduino-0022\libraries\TVout\TVoutPrint.cpp:197: error: no 'void TVout::printPGM(const char*)' member function declared in class 'TVout'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
Well, let me say that I am fairly new to the arduino programming also. But I have struggled through several programs .
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.
What I do notice is:
All the lines that reference a font are not compiling.
for example : TV.select_font(_8X8);
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.
I might try to retype that line and see if it gets by the compiler.
Also, lines without ; or not using capital letters if they are required are possible problems.
Keep me posted
sketch_mar31a.cpp:10:21: error: TVout.h: No such file or directory
sketch_mar31a:38: error: 'TVout' does not name a type
sketch_mar31a.cpp: In function 'void drawGameScreen()':
sketch_mar31a:90: error: 'TV' was not declared in this scope
sketch_mar31a.cpp: In function 'void drawBox()':
sketch_mar31a:132: error: 'TV' was not declared in this scope
sketch_mar31a.cpp: In function 'void drawMenu()':
sketch_mar31a:154: error: 'TV' was not declared in this scope
sketch_mar31a:155: error: '_8X8' was not declared in this scope
sketch_mar31a:157: error: '_5X7' was not declared in this scope
sketch_mar31a.cpp: In function 'void setup()':
sketch_mar31a:198: error: 'TV' was not declared in this scope
sketch_mar31a:198: error: '_NTSC' was not declared in this scope
sketch_mar31a.cpp: In function 'void loop()':
sketch_mar31a:225: error: 'TV' was not declared in this scope
sketch_mar31a:236: error: 'TV' was not declared in this scope
sketch_mar31a:240: error: 'TV' was not declared in this scope
sketch_mar31a:256: error: 'TV' was not declared in this scope
sketch_mar31a:258: error: 'TV' was not declared in this scope
sketch_mar31a:274: error: 'TV' was not declared in this scope
sketch_mar31a:274: error: '_8X8' was not declared in this scope
sketch_mar31a:281: error: '_5X7' was not declared in this scope
sketch_mar31a:289: error: 'TV' was not declared in this scope
hmmm im struggling here all part of the learning curve i guess :-)
My Documents\Downloads\arduino-0021\arduino-0021\libraries
hope this works :), worked for me, but the image was slightly on an angle and scrolling downn :(
trying to fix it
http://code.google.com/p/arduino-tvout/
And if you click on "wiki" 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.
see my comment above for details
the line;
ballVolY += 2 * ((ballY - leftPaddleY) - (PADDLE_HEIGHT / 2)) / (PADDLE_HEIGHT / 2);
and then it is tested against Max Y velocity in these lines:
//limit vertical speed
if(ballVolY > MAX_Y_VELOCITY) ballVolY = MAX_Y_VELOCITY;
if(ballVolY < -MAX_Y_VELOCITY) ballVolY = -MAX_Y_VELOCITY;
so there will be an increment in speed and it will be limited by Max y Velocity
However I found the overall speed can be greatly influenced by this line:
if(frame % 3 == 0) { //every third frame
if you change 3 to other numbers you can speed it up or slow it down greatly. Atleast that is what I found.
Hope that helps.