02-13-2013 07:16 AM
I am testing a stepper motor by using A4988 board (similar to easydriver board) and Arduino Uno. The Version of the LIFA is 2.2.
In one of the examples, "Arduino stepper motor.vi", the picture shows how to connect a easydriver board to Arduino. See pic below.
It indicates that Pin3 for step, Pin2 for direction. But I found it is opposite in the program, one need swap the 2 pins to get motor run.
This bug comes from the fact in file AccelStepper.cpp, the second parameter is defined as direction, but labview sends Pin3 instead Pin2.
....................................................
void AccelStepper::step1(uint8_t step)
{
digitalWrite(_pin2, _speed > 0); // Direction
// Caution 200ns setup time
digitalWrite(_pin1, HIGH);
// Delay the minimum allowed pulse width
delayMicroseconds(_minPulseWidth);
digitalWrite(_pin1, LOW);
}
.......................................................
This is a wrong definition as compared to the picture shown above.
11-20-2013 12:57 AM
when i tried to use this vi the motor started stepping only when i connected the step pin to pin 1 and not to pib 2 or 3
do you know what could be the problem?