Originally Posted by
clough42
The short answer, if you're using the Pololu 1209 motor is that I have them wired blue-red-green-black. You may have to flip the connector if the motor turns the wrong way.
In general, a four-lead stepper motor has two coils. You can use an ohmmeter or continuity tester to figure out which wires are connected to the same coil. On the Pololu motor, you'll find that the blue and red wires are connected to one coil and the black and green wires are connected to the other
You can also figure it out with no tools. If you connect two wires from the same coil together, the motor will get harder to turn by hand and you will know you've found a pair.
Once you figure out the coils, just connect the wires in order, the two wires from one coil, followed by the two wires from the other cool. Order doesn't matter, except to change the motor direction. If your motor turns the wrong way, just turn the whole connector around on the board.
Pro tip: if you need to extend your motor wires, Makerfarm has motor extensions really cheap. As in cheap enough that I buy ten or twenty every time I place an order, just for the wire.