Update: I've posted a new Easy Driver 4.2 Tutorial for those who are using the new design.
A quick tutorial on how to get things up and running with the EasyDriver v3.1 Stepper Motor Driver Board. A big thank you to Brian Schmalz, the designer of this board. It's obvious why he has called it the EasyDriver. It was indeed, an "EasyDriver" to set up ;)
PLEASE NOTE: some people have overlooked the extra (ground) pin on the easydriver board. It is not labeled on the board itself, but it is visible as the top right pin in the picture above. Grounding the easydriver board is essential but sometimes overlooked by newbies like myself :)
WARNING Easy Driver v4.2:
Please do not attempt this tutorial with new Easy Driver v4.2 board. Please consult the QA for version 4.2 on the Easy Driver Site for explanations on 4.2's extra functionality. For more information you can always look at the Data Sheet and Schematic as well.
Here is a copy of the code used in this Video:
//////////////////////////////////////////////////////// // Stepper Motor skecth for use with the EasyDriver 3.1 //////////////////////////////////////////////////////// // Dan Thompson 2008 // // Inpired by the code and chat on this thread. // http://forum.sparkfun.com/viewtopic.php?t=10378&highlight=easydriver // // Use this code at your own risk. // For all the product details visit http://greta.dhs.org/EasyDriver/ // For the full tutorial visit http://danthompsonsblog.blogspot.com/ // int dirpin = 3; int steppin = 12; void setup() { Serial.begin(9600); pinMode(dirpin, OUTPUT); pinMode(steppin, OUTPUT); } void loop() { int i; digitalWrite(dirpin, LOW); // Set the direction. delay(100); Serial.println(">>"); for (i = 0; i<4000; i++) // Iterate for 4000 microsteps. { digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the digitalWrite(steppin, HIGH); // "Rising Edge" so the easydriver knows to when to step. delayMicroseconds(200); // This delay time is close to top speed for this } // particular motor. Any faster the motor stalls. digitalWrite(dirpin, HIGH); // Change direction. delay(100); Serial.println("<<"); for (i = 0; i<4000; i++) // Iterate for 4000 microsteps { digitalWrite(steppin, LOW); // This LOW to HIGH change is what creates the digitalWrite(steppin, HIGH); // "Rising Edge" so the easydriver knows to when to step. delayMicroseconds(200); // This delay time is close to top speed for this } // particular motor. Any faster the motor stalls. }