LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong pins definition in the Arduino stepper motor vi

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.

Untitled.png

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.

0 Kudos
Message 1 of 2
(4,311 Views)

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?

0 Kudos
Message 2 of 2
(3,009 Views)