Need help programming LEONARDO as gamepad (2 analog joysticks)

Hey guys ! I am currently working on a custom game controller which uses 2 Joysticks, and 12 buttons.

I tried UnoJoy and DoubleJoy and some other examples but I can't get it to work properly as a game controller. I did upload the example code to test if the PC sees a game controller, and tested it, that part works. But then I don't know which code to upload to have it working as a game controller.

It is currently working as a Keyboard, the buttons are working fine but the joysticks only send digital outputs since Keyboards don't send in variable data, at least that's how I see it...

Mouse controlling is also not a good idea since both joysticks would try to control the mouse at the same time in different directions and it'd be messy.

Joysticks are pins A0-A3 (AnalogRead), Joysticks buttons on A4&A5 (DigitalRead), and buttons are D2-D13 (DigitalRead).

So yeah, I am looking for some spoonfed complete code if someone wants to share his own.

Thanks!

Kevin

If you were unable to find such a project using Google then you will probably have to lear quite a bit about USB to get it to work. You can use the HID part of the Arduino core as a starting point. Here is a useful reference:

http://www.usb.org/developers/hidpage/Hut1_12v2.pdf

I will definitely read that over the next days ! Thanks !!