You are here: start » networkedobjects » pong_project

Pong

So for this week we need to build a physical controller that can connect to a pong game which is hosted on a computer on the internet and simply able to control one's paddle by this controller. The whole progress was kind of straightforward as for how the instructions goes. Only since it is physical, in its nature it comes with problems.

I took the project from connecting a website with my xport and scraping the page. I actually spent a good amount of time on that after last week's instructions and would able to do it at last. This time I had other problems like no matter what I couldn't reset my arduino. Nick suggested me using a transistor which would help me to cut down the power going to xport and this would eventually reset the board. He was kind enough to help me build it too. Only, after five minutes when I reprogrammed the chip it simply started not working, not a single response. All debugging started again and took me another 5 hours until I realized that the chip is fucked up at some point. I changed the chip on the Arduino board and it worked. Also funnily enough when I truncated some of the code an programmed the chip it worked until that point again. So my guess was there was some physical memory problems with that part of the chip or so…

After that it was pretty straighforward with Tom's pong code. I used two photocells instead of an accelerometer and this helped me to optimize the data I am sending over the network as well. In default sense what we do with the pong is sending “l” if we are above certain threshold and sending “r” if it is below that threshold. In my circuit sincee I had two sensors, whatI was checking was if it is below certain value send some data and if it is not don't send anything. It worked smoothly. Here is my circuit in a picture I took with my Nokia N80. So excuse me for the quality of the picture.

10092006032.jpg

Here is very basic controller for the pong game. I really like the simplicity and the feeling of this. Basically if you press left, it goes left and if you press right it goes right :) Since I am not flooding the server with data and only sending it when it is below a certain threshold it works smoothly.

10302006056.jpg

This page last modified on 2006/10/30 10:54.