#define LED1_PIN 2
#define LED2_PIN 3
#define LED3_PIN 4
#define LED4_PIN 5
#define LED5_PIN 6
#define LED6_PIN 7
#define LED7_PIN 8
#define BUTTON_PIN 9
void setup() {
pinMode(LED1_PIN, OUTPUT);
pinMode(LED2_PIN, OUTPUT);
pinMode(LED3_PIN, OUTPUT);
pinMode(LED4_PIN, OUTPUT);
pinMode(LED5_PIN, OUTPUT);
pinMode(LED6_PIN, OUTPUT);
pinMode(LED7_PIN, OUTPUT);
pinMode(BUTTON_PIN, INPUT);
}
void loop() {
if (digitalRead(BUTTON_PIN) == HIGH) {
digitalWrite(LED1_PIN, HIGH);
digitalWrite(LED2_PIN, HIGH);
digitalWrite(LED3_PIN, HIGH);
digitalWrite(LED4_PIN, HIGH);
digitalWrite(LED5_PIN, HIGH);
digitalWrite(LED6_PIN, HIGH);
digitalWrite(LED7_PIN, HIGH);
}
else {
digitalWrite(LED1_PIN, LOW);
digitalWrite(LED2_PIN, LOW);
digitalWrite(LED3_PIN, LOW);
digitalWrite(LED4_PIN, LOW);
digitalWrite(LED5_PIN, LOW);
digitalWrite(LED6_PIN, LOW);
digitalWrite(LED7_PIN, LOW);
}
}