Wednesday, 23 May 2012

Anyone for Pong?

After a tough week and a general lack of time to tinker with things electronic, I finally have some results worth bleating about. I had made a game controller of sorts some time ago, but I have finally got an opportunity to solder on a makeshift 4-way header so it can be plugged into the breadboard. Consisting of a 10k potentiometer and a momentary push-button switch in a small, slanted black plastic case I had lying around that came from Maplin (I got another a few weeks ago, to make a second controller) along with a length of 4 core mouse cable and a chicken-head knob that I had a few of in my parts box.
Sony, Microsoft - be afraid, be very afraid :).
I have reverted to Arduino 0023 for the time being so I could compile and upload some working software, and a version of 'Pong' I found on the Arduino Forum seemed like a good first tryout to see what I can expect in terms of output quality and usability of anything I may choose to run. The sketch requires two 10k pots wired as a voltage divider connected to 5v, GND and inputs 0 and 2 for player 1 and 2 respectively, so I wired my 'gamepad' with one, plus a pushbutton wired as per the basic Arduino tutorial for reading a switch for future use. For the purposes of testing, I wired the output of the pot to both inputs (0 and 2) so that both of the paddles would move together when playing Pong, although this could prove to be the basis of a whole single player mode of the game once I get to grips with the software side of things.
Ping-pong.
An idea I did have, was to use the two unused lines contained within the ps2 mouse/keyboard interface for the 'gamepad', enabling me to use one 6 pin DIN connector for both the keyboard (when I get round to it) and Player 1's controller.  Finally I got to use my little 7" TFT monitor, I bought it so I didn't have to lug a heavy old CRT around everywhere when I want to mess about with my Spectrum stuff, but it's turned out to have more uses than I ever thought possible.

No comments:

Post a Comment