char msg[80]; // array to store incoming characters
int idx = 0; // index into array
int leDPins[] = {15, 2, 4, 5};
int numLeds = 4;
int i = 0;
int a ,b;
void setup() {
// array of GPIO pins
Serial.begin(115200);
Serial.println("Program start ");
for (i=0; i < numLeds; i++) {
pinMode(ledPins[i], OUTPUT);
}
// Initialize each GPIO pin as an output and turn on the LED
for (i = 3 i >= 0; i--) {
digitalWrite(ledPins[i], LOW);
}
//----------------------------------------------
a=0 , b =1;
if ( (a==1) && (b==1) ) // a==1 and b==1
{
for (i = 3; i >= 0; i--)
{
digitalWrite(ledPins[i], HIGH);
}
}
if ( (a==0) && (b==0) ) // a==1 and b==1
{
for (i = 3; i >= 0; i--)
{
digitalWrite(ledPins[i], LOW);
}
}
if ( (a==1) && (b==0) ) // a==1 and b==1
{
digitalWrite(ledPins[0], LOW);
digitalWrite(ledPins[1], HIGH);
digitalWrite(ledPins[2], LOW);
digitalWrite(ledPins[3], HIGH);
}
if ( (a==0) && (b==1) ) // a==0 and b==1
{
digitalWrite(ledPins[0], HIGH);
digitalWrite(ledPins[1], LOW);
digitalWrite(ledPins[2], HIGH);
digitalWrite(ledPins[3], LOW)
}
}
void loop() {
}