OK first thanks for your advices they are really helpful for me! Now i've learned something with arrays and i see it's quite quicker to program with them! So i rewrote the code with arrays so it come back something like this
int led[]={8,9};
int button[]={5,2};
int val;
void setup(){
for(int i=0;i<2;i++){
pinMode(led[i],OUTPUT);
pinMode(button[i],INPUT);
}
}
void loop(){
for(int i=0;i<2;i++)
{
val=digitalRead(button[i]);
//Turn on led
if(val==HIGH){
digitalWrite(led[i],HIGH);
}
else{
digitalWrite(led[i],LOW);
}
}
}
and then i didn't get what you mean with press both buttons.What I mean is: if i PRESS on them and status of buttons change both on HIGH i want leds to turn completly off instead of turning both on! Again really thanks for you help and for your patience on me! ![]()