Need help by converting a old gameport joystick to usb

Hi, i need some help converting a old gameport joy stick... I have this simple code that
just outputs the X and Y axis of the joystick by reading analog input:

#define SW 4

void setup() {

void loop() {
  int X_value=analogRead(A3);

  int Y_value=analogRead(A4);

  int switch_value=digitalRead(SW);



My only issue that i dont have a leonardo which lets you act as a keyboard or mouse,etc
only the arduino uno, and also the code cant do that.. i also heard some arduino unos have the same chip as the leonardo but i think i have the atmega something something.. Any posibility i can make a virtural joystick using some sort of software..
if possible i need windows and linux solutions...

Cheers :smiley:

Have you seen this?
GitHub - jdelacroix/arduino_usb_gameport: A USB-to-Gameport joystick adapter implemented on the Arduino.

what is that not sure, how do i use i

Sorry, it's not super clear, but there's a link to the entire project there.
Here it is too:
Using a PC Joystick with the Arduino | Built to Spec (

hmm yeah its basicly the same code i have it just reads analog voltage and just prints it into the serial monitor..

Here's a better article on the HID side of the interface:
Making an Arduino Human Interface Device (HID) - OKdo

This will only work on certain Arduinos, the Leonardo, Micro, Zero and Due (or any 32U4 based board). This is because they have a USB module built in whereas something like the Uno or the Mega does not.

i found a better way

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.