// Define the pin numbers for the button and LEDs const int buttonPin = D1; // Where the button is connected const int ledPin1 = D0; // Where the first LED is connected const int ledPin2 = D7; // Where the second LED is connected void setup() { // Set the button pin as INPUT pinMode(buttonPin, INPUT); // Set the LED pins as OUTPUT pinMode(ledPin1, OUTPUT); pinMode(ledPin2, OUTPUT); } void loop() { // Read the state of the button int buttonState = digitalRead(buttonPin); // Check if the button is pressed if (buttonState == HIGH) { // If the button is pressed, turn on both LEDs digitalWrite(ledPin1, HIGH); digitalWrite(ledPin2, HIGH); } else { // If the button is not pressed, turn off both LEDs digitalWrite(ledPin1, LOW); digitalWrite(ledPin2, LOW); } }