आप इसे बर्दाश्त कर सकते हैं, और आप वास्तव में एक स्टेपर के साथ काम बनाना चाहते हैं सुपर आसान की जाँच आसान Stepper । मैं बहुत प्रसन्न हुआ।
से उदाहरण कोड पेज
http://www.sc-fa.com/blog/wp-content/uploads/2013/04/20130414-080645.jpg
Example 1: Basic Arduino setup
This is the most basic example you can have with an Arduino, an Easy Driver, and a stepper motor. Connect the motor's four wires to the Easy Driver (note the proper coil connections), connect a power supply of 12V is to the Power In pins, and connect the Arduino's GND, pin 8 and pin 9 to the Easy Driver.
Then load this sketch and run it on your Arduino or chipKIT:
void setup() {
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
}
void loop() {
digitalWrite(9, HIGH);
delay(1);
digitalWrite(9, LOW);
delay(1);
}
एक ही पृष्ठ से, यहां दो उदाहरण कोड को दो ईज़ीस्टीपर बोर्ड के साथ चलाने के लिए है, त्वरण / मंदी के साथ:
http://www.sc-fa.com/blog/wp-content/uploads/2013/04/20130414- 081018.jpg
#include <AccelStepper.h>
// Define two steppers and the pins they will use
AccelStepper stepper1(1, 9, 8);
AccelStepper stepper2(1, 7, 6);
int pos1 = 3600;
int pos2 = 5678;
void setup()
{
stepper1.setMaxSpeed(3000);
stepper1.setAcceleration(1000);
stepper2.setMaxSpeed(2000);
stepper2.setAcceleration(800);
}
void loop()
{
if (stepper1.distanceToGo() == 0)
{
delay(500);
pos1 = -pos1;
stepper1.moveTo(pos1);
}
if (stepper2.distanceToGo() == 0)
{
delay(500);
pos2 = -pos2;
stepper2.moveTo(pos2);
}
stepper1.run();
stepper2.run();
}