Step 4: Motor Circuit

Picture of Motor Circuit
Getting the motor running is pretty simple because of the motor control shield. Its just a matter of getting wires plugged in the right places.

Start by attaching leads to your motor if this hasn't been done already. These don't need to be really long, a few inches, but it is easier to cut them shorter than longer later, so err on the side of caution. With the motor shield attached to your Arduino, place one of the motor leads into the MA1 slot and the other into the MA2 slot on the motor shield. Grab one of your 9V (or otherwise if needed) battery clips and place the black, ground, wire in the GRD slot on the shield and the red, positive, wire into the Vcc slot, again on the board. That's it, quick and painless, or so it seems so don't celebrate until you've ran the test program below or developed your own.

Attached is an Arduino program to test the functionality of your motor. The program simply runs the motor in one direction for 5 seconds, waits for 3 seconds, reverses the motor for 5 seconds, and waits 3 more seconds and repeats this ad nauseum. If your motor control shield is different you probably will have to rewrite the motor controls in all the sketches. My shield came with a library, I don't know if this library is universal or if it is specific to the L239D chipset. Also attached is the necessary library if you want to give it a try (It's the zip file).