Monday, January 5, 2015

Interfacing an Old School 15 pin Joystick

Today I'm working with an older PC style 15 pin joystick. This predates the newer USB joysticks by a couple of decades, and makes it a lot easier to interface with the Arduino. I'm using a joystick shield that's made by Lectrobox, with a Joystick made by Suncom. Any 15 pin IBM PC Joystick will work fine. It's only wired for one joystick, so you would need two shields for two joysticks, or mod the shield (moderate difficulty), for use with a Y splitter.

There's no wiring involved, and the onboard jumpers allow you some selection in Arduino pins.

Note: To connect a PS/2 keyboard, see http://www.instructables.com/id/Creating-the-PS2-Keyboard-smart-interface-for-micr/


The sample code provided outputs the analog positions of the stick, and the digital positions of the two buttons:


I'd recommend using interrupts for the buttons (pins 2 & 3) so as to not miss button presses, with some debounce code, but that will take some moderate shield modifications. You will probably have to play with your stick adjustments to get zero readings at rest. You can build your own shield, with a female 15p D Sub, and wire it for 2 joystick operation if you want, or stack a second shield. See http://www.built-to-spec.com/blog/2009/09/10/using-a-pc-joystick-with-the-arduino/ for more info. A Y Splitter Cable would allow two joysticks to a single port in this scenario. The joystick Shield above only is wired fore one.

No comments:

Post a Comment