// Pins for LEDs #define Led1 0 // Example GPIO pin for LED 1 #define Led2 1 // Example GPIO pin for LED 2 #define Led3 2 // Example GPIO pin for LED 3 #define Led4 3 // Example GPIO pin for LED 4 #define ButtonPin 4 // Example GPIO pin for the button void setup() { pinMode(Led1, OUTPUT); // Set LED pin 1 as an output pinMode(Led2, OUTPUT); // Set LED pin 2 as an output pinMode(Led3, OUTPUT); // Set LED pin 3 as an output pinMode(Led4, OUTPUT); // Set LED pin 4 as an output pinMode(ButtonPin, INPUT_PULLUP); // Set button pin as input with internal pull-up resistor } void loop() { if (digitalRead(ButtonPin) == LOW) { // If button is pressed digitalWrite(Led1, HIGH); // Turn LED 1 on digitalWrite(Led2, HIGH); // Turn LED 2 on digitalWrite(Led3, HIGH); // Turn LED 3 on digitalWrite(Led4, HIGH); // Turn LED 4 on } else { digitalWrite(Led1, LOW); // Turn LED 1 off digitalWrite(Led2, LOW); // Turn LED 2 off digitalWrite(Led3, LOW); // Turn LED 3 off digitalWrite(Led4, LOW); // Turn LED 4 off } }