LabVIEW Interface for Arduino Blog

Community Browser
Labels
cancel
Showing results for 
Search instead for 
Did you mean: 

cann't work a stepper motor with labview, arduino and easy drive 4.4

kobied
Member

Hello

I'm new to labview and arduino, I have installed all the needed software and hardware need to run labview and arduino uno.

I have an easy drive 4.4, stepper motor and power supply.

I have done all the arduino learn kit cirects using labview and all worked OK, so I think have all the needed software and hardware correctly.

when i try to operate a stepper motor using the labview example (the one which comes with the LVIFA) nothing happens, i tested the motor and the hardware using the arduino example code and the motor work.

can someone help me i'm quite desperate.

arduino code:

int Distance = 0; // Record the number of steps we've taken

void setup() {               
pinMode(8, OUTPUT); 
pinMode(9, OUTPUT);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
}

void loop() {
digitalWrite(9, HIGH);
delayMicroseconds(100); 
digitalWrite(9, LOW); 
delayMicroseconds(100);
  Distance = Distance + 1;   // record this step
  
  // Check to see if we are at the end of our move
  if (Distance == 3600)
  {
    // We are! Reverse direction (invert DIR signal)
if (digitalRead(8) == LOW)
    {
digitalWrite(8, HIGH);
    }
    else
    {
digitalWrite(8, LOW);
    }
    // Reset our distance back to zero since we're
    // starting a new move
    Distance = 0;
    // Now pause for half a second
    delay(500);
  }
}

thank.

kobi

Comments