3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Convert a NES gamepad to USB with Arduino

Step 2Software

Software
I am not smart enough to figure half of this usb stuff out, so were using a library, In researching this on good old google, I found http://www.arduino.nl/?p=36

Now there is a couple things to note on this page

1) its based off of the usb keyboard library found on rancid bacon
http://code.rancidbacon.com/ProjectLogArduinoUSB, which REQUIRES arduino 0016! I have messed around with this for a few days trying to get it to compile on arduino 18 software, and though it wants to work the computer never can communicate with the device, leaving a ugly balloon next to my clock, the joystick library flat out does nothing on 18

arduino 16 started to be a pain in the butt, and not start up for me, what I figured out is I needed to remove the preferences.txt file that 18 had placed in my user folder, and then start arduino 16, it should work, and 18 continues to work off of 16's file

see http://www.arduino.cc/en/Hacking/Preferences so see where you can find yours if you need too

2) The comments of the joystick library page state that it doesn't compile, and it doesn't, its not that hard to fix, and I already have in the software download. But if anyone else wants to know ...

in UsbJoystick.h you need to include interrupt.h with the other 2 includes, and change line 105 from...

void sendJoystick(byte val0, byte val1, byte val2, byte val3, byte val4 , byte val5 , byte val6, byte val7) {

to

void sendJoystick(uchar val0, uchar val1, uchar val2, uchar val3, uchar val4 , uchar val5 , uchar val6, uchar val7) {

Finally, after fiddling with this library for nearly 2 solid days, I gave up on changing its configuration, so the computer sees a 6 axis 4 button joystick, even though it only responds to 2 axis and 4 buttons


Moving on, down below you will see 2 files, the zip file contains the fixed usbjoystick lib, place that in the /hardware/libraries folder of arduino 16, and my project files, open the pde file in arduino 16, compile and upload

otherwise if you have a avr programmer handy and dont mind dealing with avrdude there is also a hex available
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
57
Followers
13
Author:osgeld