int button[4]= {2,3,4,5};
int LED[4]={8,9,10,11};
void setup() {
for(int i=0;i<4;i++){
pinMode(button[i], INPUT);
digitalWrite(button[i], HIGH);
}
for(int i=0;i<4;i++){
pinMode(LED[i],OUTPUT);
}
}
void loop () {
for(int i=0;i<1;i++){
if (digitalRead(button[i])==LOW)
for(int i=0;i<1;i++){
digitalWrite(LED[i], HIGH);
} else{
digitalWrite(LED[i], LOW);
}
}
for(int i=1;i<2;i++){
if (digitalRead(button[i])==LOW)
for(int i=1;i<2;i++){
digitalWrite(LED[i], HIGH);
} else{
digitalWrite(LED[i], LOW);
}
}
for(int i=2; i<3; i++){
if (digitalRead(button[i])==LOW)
for(int i=2;i<3;i++){
digitalWrite(LED[i], HIGH);
} else{
digitalWrite(LED[i],LOW);
}
}
for(int i=3; i<4; i++){
if(digitalRead(button[i])==LOW)
for(int i=3; i<4; i++){
digitalWrite(LED[i], HIGH);
} else{
digitalWrite(LED[i], LOW);
}
}
}