01-03-2021 10:22 AM
hey I am trying to control a stepper motor with help of arduino nano. Can somebody help me in converting the arduino code to LabView VI.
The arduino code is :
const int stepPin1 = 3;
const int dirPin1 = 4;
void setup()
{
pinMode(stepPin1,OUTPUT);
pinMode(dirPin1,OUTPUT);
}
void loop()
{
digitalWrite(dirPin1,HIGH);
for(int x = 0; x < 200; x++)
{
digitalWrite(stepPin1,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin1,LOW);
delayMicroseconds(500);
}
delay(1000);
digitalWrite(dirPin1,LOW);
for(int x = 0; x < 200; x++)
{
digitalWrite(stepPin1,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin1,LOW);
delayMicroseconds(500);
}
delay(1000);
}
Thanks in advance.
01-03-2021 11:31 AM
Hi veNKY7,
@veNKY7 wrote:
Can somebody help me in converting the arduino code to LabView VI.
Why do you want to do that?
Why don't you stick with your Arduino code and just add some communication using the (virtual) COM port of the Arduino?
(The Arduino can control the timing much better on its own than you could do using LINX…)
01-03-2021 12:27 PM
because I created a vi. Based on the inputs from vi stepper motor should operate
01-03-2021 12:31 PM
can i use arduino nano in labview interface with arduino examples
01-04-2021 12:09 AM
Hi veKNY7,
@veNKY7 wrote:
because I created a vi. Based on the inputs from vi stepper motor should operate
I still don't see a reason to convert Arduino code to LabVIEW VI.
Is there a reason you cannot use simple VISA on LabVIEW side with some more Arduino code on the other side?
01-04-2021 12:20 AM
Hi veNKY7,
@veNKY7 wrote:
can i use arduino nano in labview interface with arduino examples
Which interface are you talking about?
I still recommend to use simple VISA "interface" with some more Arduino code handling the serial port…