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.

Use an Arduino with an N64 controller

Use an Arduino with an N64 controller
There are tutorials out there for using an NES controller with an Arduino, but using the more complicated N64 controller and its analog joystick has a definite appeal. If you have an Arduino around and don't want to buy an Adaptoid, this instructable will make it possible to play emulated games in Project 64 with your Ardunio and an N64 controller.

Is this hard? / Will it damage my stuff?
This will not modify your controller in any way, and the wiring is extremely simple, so if you do everything carefully there should be no risk to your controller, and you can unhook it at any time to use with a N64 console.

What you will need:
Arduino - $30
Processing 1.0 - free
Arduino Software - free
3 pieces of wire - free (I hope)
USB cable


 
Remove these adsRemove these ads by Signing Up
 

Step 1Wiring the controller

Wiring the controller
The first thing you need to do is connect your Arduino to the controller
The controller only uses three leads: +3.3V, signal, and ground.
Looking directly at the plug, ground is farthest left, signal is in the middle, and +3.3V is on the right. Using the wire, connect ground and +3.3V to the respective pins on the Arduino, and connect the signal lead to the Digital 2 pin on the Ardunio.

NOTE: If you have other code on your Arduino, you should disconnect the controller and upload the new code from the next page to the Arduino before powering it up with the controller attached.

Connect the Arduino
Connect the USB cable and the Arduino will have power.
« Previous StepDownload PDFView All StepsNext Step »
67 comments
1-40 of 67next »
Apr 12, 2012. 2:44 PMxenoinc says:
Great post!

With the new version of Arduion-1.0 i did have to include the "import" stuff & as well take care of RXTX-2.2pre1 / RXTX-2.2pre2 (see below)


Minor Issue:
Has anyone made a patch yet for the controller's sensitivity? With a lot of games this is a HUGE problem.

Overall, great job throwing together the documentation


Fix the RXTX errors:
http://rxtx.qbang.org/wiki/index.php/Download
May 11, 2012. 9:15 PMPOSSESSEDFERRET says:
Hey xenoic, which version do I need to download? And do I need the source or binary?
May 14, 2012. 7:30 AMxenoinc says:
Currently they are only offering "RxTx-2.2 pre2". So this should help you out.

just pull back the latest RxTx 2.2 preview version & you should be good
May 23, 2012. 5:15 PMJdbye says:
I followed this guide and it worked well.
However, I wanted analog stick support, so I wrote a plugin for Project64 and other emulators.
The only thing that's missing is Memory Pak, Rumble Pak and Transfer Pak support (like the Adaptoid has)
I have no idea how to implement either of them and there doesn't seem to be much of help on google, nor can I find the source code of the Adaptoid plugin/driver, so if anyone could point me in the right direction that would be great.
May 25, 2012. 2:14 AMJdbye says:
Oh, also, Rumble Pak support would be pretty easy to add. I would add it if I knew where my Rumble Pak was.
May 25, 2012. 2:11 AMJdbye says:
Here: http://dl.dropbox.com/u/8225581/ArduiN64.zip
Only one controller is supported at the moment, but adding support for more would be easy. Mempaks work however by letting the emulator handle them (but that means you can't use physical mempaks)
You will probably have to change the COM port in Controller.cpp to match your Arduino's COM port (it's hardcoded for COM4 at the moment, I would add a configuration dialog to choose COM port, but I'm not sure how to make dialogs in C/C++)
Apr 25, 2012. 8:33 AMgadgehammer says:
Hey which part of the code do u add
"import java.awt.Robot;"
"import java.awt.AWTException;"
"import java.awt.event.ImputEvent;"
Apr 25, 2012. 8:40 AMgadgehammer says:
btw i am running Processing 1.5.1
May 11, 2012. 9:13 PMPOSSESSEDFERRET says:
Add them at the end of the "N64_Controller", and N64_Controller_Mouse" processing programs.
Feb 7, 2012. 9:40 AMjhawkman4 says:
hey quasse, i'm getting this lengthy error when i run either the controller or the controller_mouse pde in programming:



WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
error, disabling serialEvent() for /dev/cu.usbmodem621
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at processing.serial.Serial.serialEvent(Serial.java:238)
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:772)
at gnu.io.RXTXPort.eventLoop(Native Method)
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1641)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 12
at java.lang.String.charAt(String.java:686)
at N64_Controller_mouse.serialEvent(N64_Controller_mouse.java:81)
... 8 more



any ideas?
Apr 12, 2012. 2:42 PMxenoinc says:
Step by step procedure to fix your issue:

http://rxtx.qbang.org/wiki/index.php/Download
Mar 14, 2012. 12:24 AMabadfart says:
im not really familiar with Arduino could you give me an idea of how to hook 4 controllers so i can play 4 player super smash brothers
Dec 12, 2011. 11:13 PMgamemasterful says:
The duke url is dead. Fortunately the code was ported. https://github.com/brownan/Gamecube-N64-Controller is where the stuff is posted now.
Dec 27, 2011. 8:23 AMdiy_bloke says:
Only the pde and the 'h' file there for Arduino the library shld have an 'h' file and a 'cpp' file ergo: compiling errors on the Arduino IDE
Jul 28, 2010. 12:54 PMDONPATCH says:
I get an error running your n64_controller program saying "cannot find a class or type named robot" can somebody help me.
Dec 27, 2011. 8:18 AMdiy_bloke says:
add to what?
Jul 28, 2010. 1:17 PMDONPATCH says:
thaks
Nov 30, 2011. 8:32 PMisharrow says:
Im trying to import this to arduino ATMega 2560 and I am having issues with the fact my button presses don't show up in the serial monitor and am having issues with processing (1.5.1) error: (gnu.io.PortInUseException: Unknown Application)
and error 2:( Exception in thread "Animation Thread" java.lang.RuntimeException: Error inside Serial.() ) Insight is apreciated. (Edit: it may be because im not using the right size of wire (AWG 23) or the fact i never tinned the Arduino end)
Aug 7, 2011. 10:22 PMMambaJack says:
Hello,
I am using Processing 1.5.1. I am getting the same error as ppl below on the robot class thing. I copied and pasted the code u said to copy and paste at the top of the sketch. I am complete noob at this stuff. It would be great if you could post a copy of Processing 1.0 to use.

Thank you :)
Aug 7, 2011. 1:33 PMmatstermind says:
does anyone know of a way to do this with a gamecube or dreamcast controller?
Aug 7, 2011. 5:51 AMFr3sc0 says:
I just made this, it works like a charm. Adding a second controller is possible as long if there is a second 3.3v pwr supply available? Just alter the key bindings was my idea. Would that work?

Thank, and a very nice project :)
Jul 19, 2011. 9:36 PMpblanscet says:
it would be better and easier to just wire up white to green, red to red, and black to black on a usb cable. tried it myself. works
Apr 13, 2011. 7:22 PMMotta says:
More awesome would be an Gamecube/N64 Arduino library, just like the one of PS2 controller...
Nice instructable!
Feb 16, 2011. 11:09 AMwowplayer312 says:
it's not working for me. i have everything running and my controller works but no activity. nothing happens. what does the 0,1 or 2 mean in "Serial.list()[0];"??
Mar 4, 2011. 3:14 PMjohnparker says:
In the Arduino IDE goto tools/serial port. Whichever port you chose for arduino is checked. count how far down the list it is(begin your counting with zero). that number is the one you use. it's an array listing all the com ports on your machine.

This is how I determined my number...I hope this is the right explanation...if not someone correct me.
Mar 4, 2011. 3:06 PMjohnparker says:
Great instructable....Perfect instructions...Went off without one hitch.
Nov 15, 2010. 12:04 PMallmondjoy87 says:
Thinking about getting an arduino specifically for this use..... anyone know if the arduino could support multiple (4) controllers?
Feb 4, 2011. 3:55 PMcomputergeek321 says:
maybe a arduino mega
Nov 15, 2010. 8:07 AMskuggantroll says:
Does this application work on laptops too? I have made it work on most desktops. Every time I have run it on a laptop, the program seems to work, but the N64 controller has no effect. The processing program even seems as though it worked and the picture of the super nintendo controller pops up, but still no joystick control...
Nov 1, 2010. 6:03 PMfrontispiece says:
Hey, I've loaded the Arduino sketch no problem, and can see the controller data coming in over the serial line, but the Processing sketch doesn't pass along any keys to my laptop - do you think that there could be a different keystroke protocol for running on a Mac? I've included the necessary robot files, etc.
Nov 1, 2010. 8:13 PMfrontispiece says:
Hm, the short thread here:
http://forums.sun.com/thread.jspa?threadID=5294982

seems to suggest that bundling the robot class as a jar file would make it work, but I haven't got the know-how for that - any chance you know how to get that to work?
Nov 8, 2010. 2:53 PMfrontispiece says:
(removed by author or community request)
Aug 21, 2010. 1:24 PMMambaJack says:
Hey very cool instructable, but i cant seem to get it to work everything is hooked up right. i ran both of the files but it doesnt work?? :(
Aug 21, 2010. 3:45 PMMambaJack says:
pressed = split("a", ' ');; size(540,300); frameRate(1); String portName = Serial.list()[0]; <-------- (The error is here and the message is array index out of bounds exception) N64Connection = new Serial(this, portName, 115200); try { VKey = new Robot(); } catch(AWTException a){} N64Connection.bufferUntil('\n'); buttons = "Hell0 m0t0 "; bg = loadImage("N64 Controller.jpg"); }
Aug 21, 2010. 4:50 PMMambaJack says:
Oh i have solved the problem now but it still doesnt work ??? help :(((
1-40 of 67next »

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!
7
Followers
1
Author:quasse(A Light on Few St.)