Good morning
im working in a project, im trying to make a interface with arduino and labview, and I need to use the attached pics stepper motor, but I dont know how this stepper motor works, I need some advices please!
Good morning
im working in a project, im trying to make a interface with arduino and labview, and I need to use the attached pics stepper motor, but I dont know how this stepper motor works, I need some advices please!
Looks like it has a built- in Step and Direction controller. Use the Direction pin for Direction. Use the Clock pin for Step, and use the On/Off pin for Enable. The two MS inputs probably set the micro step rate (1, 1/2, 1/4, 1/8).
If it just needs step and direction signals this demo sketch should make it work. You will need to match the connections to the code or vice versa.
// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at http://forum.arduino.cc/index.php?topic=208905.0
byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20; // microseconds
int millisbetweenSteps = 25; // milliseconds
void setup()
{
Serial.begin(9600);
Serial.println("Starting StepperTest");
digitalWrite(ledPin, LOW);
delay(2000);
pinMode(directionPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(directionPin, HIGH);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros);
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
delay(3000);
digitalWrite(directionPin, LOW);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros);
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
}
void loop()
{
}
...R