Replaced a println with print (derp).
This instructable has been updated! 1 December 2011
Remade all code from scratch.
Remade 'ible code section; Now includes a 'Processing COM port config for dummies'
Ladies and gentlemen, I proudly present 8bit pleasure.. yours for the grabbing!
Whether you use GNU/Linux, Mac OS X, or Windows
the USB NES controller is compatible.
Will this in any way alter the controller?
Nope, the controller will stay the same so you can still use it on a real NES
But I don't have an arduino ;_;
You can use the parallel port:
http://hellalame.com/nes/nes_controllers.html
Buy an arduino:
http://arduino.cc/en/Main/Buy
Or a retrozone NES kit:
http://www.joystiq.com/2004/09/07/how-to-make-a-nintendo-controller-into-a-pc-joystick
Remove these ads by
Signing UpStep 1: Ingredients for some awesome controller soup
A NES controller
An Arduino
A USB cable type B
Something you can use as a Casing
and some wire..
Optional: NES port http://www.parallax.com/Store/Components/Other/tabid/157/CategoryID/32/List/0/SortField/0/Level/a/ProductID/522/Default.aspx
Arduino software http://arduino.cc/
Processing http://processing.org/







































Visit Our Store »
Go Pro Today »




here is a video of my robot arm
http://www.youtube.com/watch?v=Va9D9Fpc5H8
P.D.- sorry for the awful english :P
here´s the code, i hope it helps someone getting the same problem
void ReadNESjoy() {
nes[0]=1;nes[1]=1;nes[2]=1;nes[3]=1;nes[4]=1;nes[5]=1;nes[6]=1;nes[7]=1;
latchlow;
clocklow;
latchhigh;
wait;
latchlow;
nes[0]=dataread;
for (int i = 1; i < 8; i++) {
clockhigh;
wait;
nes[i]=dataread;
clocklow;
wait;
}
}
Just throws a buncha error messages like "nes not declared in this scope" among other things.
I tried this today and it works but i cannot get a response outta the A button and i've tried both my NES controllers.
I have a hard time believing that the same button on both my controllers are broken, especially since my NES never saw much use.
So i'm leaning on an error in the code somewhere, i'm not a programmer and thus have no knowlefe in this stuff, so debugging is out for my part.
-----------------------------------------------------------------------------------------------------------
The "BYTE" keyword is no longer supported.
-----------------------------------------------------------------------------------------------------------
ArduinoSketch.cpp: In function 'void loop()':
ArduinoSketch.pde:-1: error: 'BYTE' was not declared in this scope
As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead.
-----------------------------------------------------------------------------------------------------------
Any ideas of how to fix this issue? //John
i think its because you/we are using a newer version of the arduino program
i just installed an alpha version and all worked fine.
give that a whirl.
i got an error code right away and on this line
import processing.serial.*;
am i doing something wrong
sorry im a newb
when trying to use the controller
I'm working on a multimedia project that would be running 24/7 and have both NES & SNES emulators available. It would be great if a user could just plug in the appropriate controller and get started without any other configuration.
Another noob question: If I have 2 NES ports and I plug in two controllers, will the "player 1" and "player 2" identities remain bound to the ports (so I can have it just like a NES, player 1 on left port, player 2 on right?)
Thanks for all you work on this! Totally RAD!
Quite easy, the clock and latch from the arduino can be connected to several controllers. You only need one seperate data line per controller.
Some code adjustments need to be made, but my guess is that you can probably hook up to 16 controllers to an arduino duemilanove and even more to an arduino mega (WHY???!!!!!).
How many controllers are you interested in hooking up?
(that is, if you still are interested lol)
I have one question and one suggestion. The suggestion is to update the code so it has the revised buttons = "this should w0rk... line in it. I struggled with that until I eventually read all of the comments.
The question is: in the arduino code it looks like you are sending a 'z' at the end of the x/o pattern, but it looks like processing doesn't look for it. Currently I get the wrong buttons pressed unless I reset the arduino by re-uploading the sketch.
Is there a way to look for the 'z' in processing so that the buffer doesn't ever slip out of sync?
Thanks for this instructible! I'll be back to post my results when I am finished!
"buttons = NESjoy.readStringUntil('\n');"
It's the Until('\n'); that does it. It looks for that to signal the end of the transmission. Thanks for putting all of this info up!
Remade the arduino and processing code completely. (2 million years later lol)
I'm quite happy with the arduino code but the processing code might still need some changes..
Sorry for not responding, I haven't been on instructables for a while.
You're right, I should update the code.. I will get round to it as soon as I'm motivated x'D
As for the additional code, I will implement it and mention you on my 'ible.
Thanks for showing interest in my 'ible =D
Greetz,
Joshua
but how do you get it working with emulators??? do you need a driver?
I've currently updated the code, you might want to try the new code (it should work much better).
The program reads the messages the arduino sends and emulates a keyboard, so you don't need drivers.
In order to configure the controllers, you simply follow the same steps you would to map controller buttons to keys except you press the buttons on the nes controller.
For FCEUX e.g.
Config > Input
[Port 1] Configure
[Virtual gamepad 1]
Press the up button in the program, press the up button on the nes controller.
Repeat for every button.
Done!
and grampafish: Check out the two lines kiwimonk posted below.
I was having trouble with the 'A' button (not working) for a while, and thought it was my Seeeduino. Read up on the controller spec.. After moving
line 38: digitalWrite(latch1,LOW);
just below line 46 everything worked!
I also had to place these imports into the Processing Script:
import java.awt.Robot;
import java.awt.AWTException;
After I got it all working I modified the code a bit to support two controllers. If anyone is interested, let me know ;)
Thank you to you and Sebastian for the great project!
You do know you can buy USB NES controllers online, right? [link]
More specifically this website: www.retrousb.com
(though it's more fun to make it yourself :P)
Greetings,
Prodigity
LCD screens won't work due to light decay and screen response, though some newer variants could work (those that support 3d shutter glasses should work).
Good luck and have fun tinkering.
The N64 controller has a completely different protocol,
I did a quick google and came up with this:
www.mixdown.ca/n64dev/
courses.cit.cornell.edu/ee476/FinalProjects/s2002/jew17/lld.html
Not impossible, but you'll have to start from scratch.
(I'll look into it)
The original N64 controller uses photocells and LEDs (like an old mouse) to read the 2 joystick positions.
I've have no experience at all with this, but you might be able to rip one of the controllers out of a mouse and let it decode it.
I'll have a better look into it.
My program cannot be used at all (neither the arduino code nor the processing code) regardless of whether you use the plug side, or directly connect the arduino to the buttons and joysticks themself.
If you could supply me with the resistances of the potmeters I could however make a sketch for you on how to implement them.