Famiclone Controller Converter 
[Source Code]
I think I lost the source code for this. Not a big deal, it's really easy to do; the most interesting part of this project is understanding how the controller works at the low level.
The step-by-step goes something like this:
- Send a 5V signal to the LATCH pin. This tells the NES controller’s shift register to capture the current button states.
- Immediately send a 0V signal to the LATCH pin. This puts the shift register into data output mode, allowing you to begin reading the stored button states.
- Read the DATA pin. This gives you the state of the first button (A). A low signal (0) means the button is pressed, and a high signal (1) means it’s not.
- Send a short 5V pulse to the CLOCK pin. This shifts the next bit (next button state) into the DATA pin.
- Repeat steps 3 and 4 for a total of 8 reads — one for each button (A, B, Select, Start, Up, Down, Left, Right).
- Once all 8 bits are read, loop back to step 1 to poll the controller again.