First and foremost, we need to connect our NXT hardware to our microcontroller. There are a few ways of going about this.
I opted for stripping a set of NXT cables I ordered from http://mindsensors.com
. I split up the wires, stripped them, soldered short lengths of solid-core wiring onto each, heatshrunk each solder joint, and heatshrunk the whole bundle of wires, creating a connector.
-In hindsight, you can buy one long wire and make two spliced wires out of it by cutting it in the middle.
-Also, make sure you keep your wires in order. The NXT wires are color-coded but the mindsensors wires are not.
-Some people have made modified RJ-12 cables and others have just worked with the originals.
Another option is to buy a female jack from mindsensors which requires little to no messing around with a soldering iron and looks a lot cleaner.
Wires are numbered from the latch side right-to-left, so the wire nearest the latch is 1 and the wire farthest from the latch is 6.
LEGO color codes them as follows:
(See image for reference)