NES to USB adaptor (Fail)

tl;dr

A simple NES controller to arduino to USB adaptor that lets you configure it to be a HID or joystick or what ever you want.

NES to USB adaptor

I’ve been playing around with RetroPie of late and this got me thinking, I would love to use the old controllers with the emulators. I took to eBay to see how much USB converters and was quite shocked at the prices. This is when I thought that someone out there must have made a NES to arduino adaptor, After a bit of looking I couldn’t find a simple all in one solution. I did find a arduino library that can read a NES controller and another that turns the arduino leonardo into a joystick. All i had to do was combine them both.

Software and libraries

So my first task was to read the NES controller. For the NES controller I used this library HERE. Now we can read the NES controllers we need to turn our arduino leonardo into a joystick the computer can read. I’m using joystick library from HERE, I’m using the joystick library in the “joystick” folder because I’m only using one controller with my project. Using the sample code and adding a bit of my own I get the arduino to be the middle man between the NES controller and the computer.

Turbo pots and a lot of failing

I was ready to pull the trigger and get the simple NES to arduino board spun, then I thought I would have a go and see if I could add in a turbo switch. After I got the turbo switch worked out I also thought wouldn’t it be cool if you could control the speed of the turbo like you can on the NES advantage pictured below

I was quite shocked to find out that I hadn’t used a potentiometer in one of my arduino projects before. If you look for potentiometer simple code HERE they use delay(); but I couldn’t use delays in my time sensitive project. I had to switch to using millis() timers like they do in the blink without delay sample code HERE.

Fail

So here comes the fail. I stupidly didn’t do enough testing with the bread boarded prototype. I’m not sure if I didn’t catch the inconsistencies while testing or thought that It must have been some dodgy wiring on the bread board. What doesn’t work is the turbo, What I was doing was using millis timers to rapidly press the and release the button (in software) that correlates to the button being held down on the controller. The turbo is really inconsistency this is what I don’t get. I can’t find anyone else that has added turbo to their NES to arduino adaptor so I can’t compare to anything else.  I will post the failed code so if anyone wants to tell me where I went wrong feel free to.

Hardware

Hardware list

  • Arduino pro micro
  • 10k ohm potentiometer
  • NES female port
  • 3 pin switch
  • 1206 blue LED
  • 1206 220 ohm resistor

schematic

NES files

Kicad board files – https://github.com/facelessloser/nes2usb_adaptor/tree/master/kicad_board_files

Arduino sketches – https://github.com/facelessloser/nes2usb_adaptor/tree/master/arduino_sketches

Github – https://github.com/facelessloser/nes2usb_adaptor

library’s

reading NES controller library – https://github.com/joshmarinacci/nespad-arduino

Joystick library – https://github.com/MHeironimus/ArduinoJoystickLibrary/tree/version-1.0

Videos

Hardware walk through – https://youtu.be/qgFyICQwugc

Advertisements

3 responses to “NES to USB adaptor (Fail)

  1. Cool project man! Maybe there is a special protocol the turbo pad was sending instead of repeating a button press. Perhaps the NES could only accept so many button instructions at once? You could pipe some power through the controller and probe the turbo to see when it’s outputting. Tried anything like that yet?

    • Thanks, glad you liked it. That’s a good point, I might have to have a look into that. It’s times like this I wish I had a scope. I think the problem was more on the retroPie/arduino side of things.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s