Skip to content

jdelacroix/arduino_usb_gameport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Arduino USB Gameport Adapter

A USB to Gameport joystick adapter implemented on an Arduino Nano (and any Arduino-compatible hardware).

Originally from "Built to Spec" [link] and modified to allow for different types of Gameport joysticks.

Hardware

The test Gameport joystick (a CH Products joystick shipped with the iRobot Magellans) has two buttons and two axes. The two axes are wired through ADC0 and ADC1 on the Arduino in parallel with two 100kOhm pull-down resistors. The two buttons are wired through D2 and D3 on the Arduino in parallel with two 10kOhm pull-up resistors.

The following table shows the Gameport wiring:

PIN1+5VDC
PIN2BTN0
PIN3AXS0
PIN4GND
PIN5GND
PIN6AXS1
PIN7BTN1
PIN8N/A
PIN9+5VDC
PIN10BTN3
PIN11AXS2
PIN12GND
PIN13AXS3
PIN14BTN2
PIN15N/A

Interface

The Arduino writes to the serial port (e.g., /dev/ttyUSB0) at 9600 baud using the following protocol (format):

$ARDJOY,TIME,BTNC,AXSC,BTN0,BTN1,...,AXS0,AXS1,...

BTNC and AXSC define the number of buttons and axes (up to 4 each).

In the future, the Arduino should advertise itself as a USB HID device, so that it becomes accessible through a joystick driver (as /dev/input/jsX).

About

A USB-to-Gameport joystick adapter implemented on the Arduino.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages