I have Arduino UNO, Bread Board, resistors, LEDs and jumper wires.
I am able to light on/off only 1 LED from my C# program. How can I set inputs to all leds to turn on/off all leds at same time through C# code?
int ledPin[] = {6,7,8,9,10,11,12,13};
void setup()
{
Serial.begin(9600);
for (int i =0;i<8;i++)
{
pinMode(ledPin[i], OUTPUT);
}
}
void loop()
{
String st="11111111";
for(int ch=0;ch < st.length();ch++)
{
if(st.charAt(ch)=='1')
{
digitalWrite(ledPin[ch],1);
}
else
{
digitalWrite(ledPin[ch],0);
}
}
}