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.
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:
|Key (Pad 1)
|Key (Pad 2)
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.