Code for a motor

What is the correct code to make a motor spin in different directions? :confused: I am using an Arduino Leonardo and on top of the Leonardo is a motor shield. I also have a breadboard if that helps too. I just need the right programming code that I could paste into Arduino (the program) to make the motor spin in different directions or just plainly make it spin. Thanks! :slight_smile: :slight_smile:

The correct code depends upon the hardware you have, and how it is wired.
Vital details you seem to have omitted.

More than likely, the shield came with example code. What shield do you have? If you've already tried the code and it doesn't work, then your wiring isn't correct.