LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing arduino code into labview environment

I'm fairly new to labview, and I would like to know how a arduino code like this be implemented in labview. 

 

int led[11] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int input, i;
void setup()
{
for (i = 0; i < 11; i++)
pinMode(led[i], OUTPUT);
//Serial.begin(9600);
}
void loop()
{
input = analogRead(A0);
//Serial.println(s);
input = input / 12; //By changing the denomintor the sensitivity can be changed
if (input < 12)
{
if (input == 0)
{
for (i = 0; i < 11; i++)
{
digitalWrite(led[i], LOW);
}
}
else
{
for (i = 0; i < input; i++)
{
digitalWrite(led[i], HIGH);
delay(4);
}
for (i = i; i < 11; i++)
{
digitalWrite(led[i], LOW);
}
}
}
}

0 Kudos
Message 1 of 1
(1,181 Views)