2012
Evening hack: NES controller
Tonight I made an adapter for my old NES control pads, so they would show up as USB devices on my computer.
I used a MinimusAVR USB v1 and a NES adapter from Parallax.
The code uses the LUFA USB stack on the Minimus to emulate a keyboard. Here are the key mappings, easy to find in the source code:
Button | Key (Pad 1) | Key (Pad 2) |
A | x | v |
B | z | b |
Select | a | f |
Start | s | g |
Up | Up arrow | i |
Down | Down arrow | k |
Left | Left arrow | j |
Right | Right arrow | l |
Here's how the adapter looks:
Source code is on Github: github.com/nfd/nes_adapter. To use, run make dfu in the normal way.
Connect CLOCK to PORTD.3, LATCH to PORTD.2, DATA2 to PORTD.1, and DATA1 to PORTD.0.
As usual, please email me with suggestions or questions.