Thanks so much for this! Got an Uno for the purpose of making a funky arduino accelerometerfmouse and was fretting about the lack of info on how to go about the USB HID part til I found this post. Can't wait to get choppin with it!

I've been lurking around in this thread for some time now.I think I've wrapped my head around the general idea.How hard would it be to add another 2 axes to the example joystick?(axes A,B,C,D instead of only X-Y)

As far as I can see, it requires some tinkering in the Descriptors.c file.Could any other "HID Usages" like Vx or Vbrx serve as my extra axes?

I think CALLBACK_HID_Device_CreateHIDReport has to return quickly, you don't have enough time to wait for serial data inside CALLBACK_HID_Device_CreateHIDReport. Instead you should process serial data in main, and just copy it in the callback.

Also you are assuming that the two characters will come to the serial port together - they won't. There will be a delay between the identification character and the data. However because main does other tasks (the USBTask() calls) you can't just block it while waiting for serial characters. Instead you have to code it as a state machine.

You want to use Serial.print or Serial.write rather than println as you don't want the extra newline.

The information on descriptors can be found here:http://www.usb.org/developers/hidpage/Unfortunately it is all very complicated and detailed. That's just the way it is.

I tried to implement the state machine you suggested Stimmer.However, I get the "adress out of range" error in Flip.I assume this is because I ran out of program space.My main loop now looks like this.

Serial_IsCharReceived and Serial_RxByte are inlines, so you can try to save space by only calling them once. Other ways to save space include removing the LED code, and shortening the product strings in Descriptors.c.