void setup() {
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6,INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
}
void loop() {
if
(digitalRead(4) == LOW) {
digitalWrite(12, HIGH);
} else {
digitalWrite(12, LOW);
}
if
(digitalRead(5) == LOW) {
digitalWrite(11, HIGH);
} else {
digitalWrite(11, LOW);
}
if
(digitalRead(6)== LOW) {
digitalWrite(10, HIGH);
} else {
digitalWrite(10, LOW);
}
if
(digitalRead(7)== LOW) {
digitalWrite(12, HIGH);
} else {
digitalWrite(12, LOW);
}
if
(digitalRead(7)== LOW) {
digitalWrite(11, HIGH);
} else {
digitalWrite(11, LOW);
}
if
(digitalRead(7)== LOW) {
digitalWrite(10, HIGH);
} else {
digitalWrite(10, LOW);
}
if
(digitalRead(7)== LOW) {
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
} else {
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW);
digitalWrite(12, LOW);
}
}