Use Mega 2560 as USB joystick (Newbie)

Hello all,

I am posting here because I have exhausted myself searching for how to make an Arduino Mega into a usb joystick.

The reason i am trying to create a usb joystick is to interact with MACH3 software. I am building a CNC router and was given an industrial joystick and trackball combo at work. (They were throwing out because they got a new one) The joystick combo used to hook up directly into the amplifier for the small motorized platform.

This is where I purchased the Arduino mega! (obviously not knowing what board would work the best)

I have successfully connected the joystick (potentiometer type) and was able to print to the serial and read from all three axis and see the values change while moving (and holding) the joystick.

Other than this I do not know what I need to do for my pc to recognize my arduino mega as a USB device let alone a joystick capable one.

Your help on what to do next would be awesome and greatly appreciated. I am not familiar with programming micro controllers so extreme details are VERY welcome.

For some background on myself. I am a mechanical engineer and I would very much like to learn more about micro controllers.

THANK YOU!!

You can do this with a Mega but you need to reprogram the 16U2 chip which is the USB interface on the board. Not easy to do and easy to screw up your Mega.

Start with a Leonardo, Micro or Teensy. The Teensy has the best libraries.

The other thing you can do is to write a helper app on the PC that takes the serial output of the Arduino and converts that into a joystick output on the PC. The language called Processing is popular for that.

I got the mega to work!

I used the big joystick hex file along with modifying some code found online (mainly to fix issues I was personally having) and now its working perfectly like a game controller!!