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