Hello everyone, I'm Mick and I managed to turn my Arduino UNO rev3 in a USB HID joystick with 4 axes and 32 buttons, which maps input from two N64 controllers to these axes and buttons; it is composed of two parts, a .ino sketch for the ATmega328p which sends a command to two N64 controllers and reads 4 bytes from each controller; the first two bytes represent the x and y axes value, which range from -128 to 127; the other two bytes represent the status for each button in each bit (0 means no pressure, 1 means button pressed); there are actually 14 buttons on a N64 controller, which means that 2 bits are unused; after reading the status of the two controllers, the sketch writes on the serial port the two statuses; the other part is an .hex file for the ATmega16u2 which let the Arduino enumerate as an HID USB joystick with 4 axes and 32 buttons , named "Arduino Joystick"; all I did was actually taking some code from this Instructable for the sketch, and from this page for the USB HID firmware; on the sketch, I just removed the unused code (it was originally meant to be also used on a GCN controller, which is a pain in the a** to connect with unless you want to tear apart a standard GCN connector from your GCN), and turned it to probe two controllers instead of only one (cos I happen to have 2 N64 controllers, and playing with a friend is much more fun!)... on the firmware code, I modified the USB descriptor part in Descriptor.c or .h , don't remember, to my specs (which is, I repeat, 4 axes and 32 buttons). So all the original credit goes to these two guys
Btw, the cool thing of this is that, not only you could use your spare N64 controllers to play with your favourite game/emulator/whateveryouwant on your PC, which is super cool by itself, but also, you could easily make your own sketch for the ATmega328p that converts some input (say 2 arcade joysticks and 32 buttons...) into two N64-like statutes (2x8 bit values, 16x1 bit values) and use it to control something on your PC! Of course, you should be aware that this sketch first writes 2 axes and 16 buttons values on the serial port, then writes 2 other axes and 16 more buttons, so don't mess up the order of the things to write on the serial port.
Here I'm also adding a Github repository I use for this code with some brief explanation of what to do to get the whole thing up and running: MickMad N64-To-USB
For future reference, I also added this github repository link in the "Interfacing with Hardware / Gamepads" section of the Arduino Playground page.
Cheers and go get your N64 controllers NOW!!
-Mick-
Ps: this is my first ever post on this forum, yay!