Game Controller

This is a game controller to play Atari’s Lunar Lander game in a browser

However, my initial idea was something different. From left to the right, it is consist of: a potentiometer (a, d) with a laser cut lunar lander on top of it. The orientation of this lander should match with the one in the game. Two buttons that represent increasing power (w) and decreasing power respectively. A larger button that matches with the space bar. A joystick that enables the mouse movement and click.

img_2578

img_2569

I really want to make the potentiometer work so I tested that if I pressed the left arrow nine times, the lander will be on its left end, the same for right side. Thus, I created 18 states for the lander and then mapped the value to 0-18, like the illustration in the middle of my sketch below. However, it is really hard to achieve that same effect that the keyboard gives with what Arduino gives. This design ended up with a crazy keyboard either does nothing or prints tons of ‘a’ and ‘d’ in my text editor.

img_2577

I decided to just use five buttons. During the process, I was totally confused by Keyboard.write() and Keyboard.press(). The device worked very well as a typewriter but it doesn’t work as a game controller in the game. My solution was to use Keyboard.press() and use Keyboard.releaseAll() when the user releases the button but I still don’t understand it.

Here is the enclosure design. I tried using standoffs. The part on the right was for the five buttons. It appears to be a supporter for all the five buttons. With this design, I ended up with no using hot glue at all 🙂screen-shot-2017-01-30-at-8-52-30-pm

Link to the code

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s