int isPressed = 0;
int butNum = 0;
void setup() {
pinMode(2,INPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
isPressed = digitalRead(2);
if (isPressed == HIGH){
butNum +=1;
}
if (butNum == 1){
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}
if (butNum == 2){
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
digitalWrite(10, LOW);
}
if (butNum == 3){
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
}
if (butNum == 4){
butNum = 1;
}
}