Page 331 - Making things move_ DIY mechanisms for inventors, hobbyists, and artists
P. 331
308 Making Things Move
FIGURE 10-21 Arduino setup to run two stepper motors
3. For the right motor:
• Arduino GND (one of the two pins) to GND on right EasyDriver
• Arduino pin 6 goes to DIR
• Arduino pin 7 goes to STEP
4. Make sure the two stepper motors work. Type in the following code, verify it,
and upload it to the Arduino.
/*
Driving two stepper motors with an Arduino through
SparkFun's EasyDriver v4.3
By Ben Leduc-Mills and Dustyn Roberts
Created: 2010.06
*/
#include <Stepper.h> //import stepper library