//This is the variable "state" int state; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(D0, OUTPUT); pinMode(D1, INPUT); } // the loop function runs over and over again forever void loop() { /* This is to get the value of the button in (D1) in the state variable and read it's signal */ state=digitalRead(D1); //This condition allows to tell the state of the LED if (state == HIGH) { digitalWrite(D0, HIGH); // This is to receive the message of the "state" on the screen Serial.println("This LED is On"); } else { digitalWrite(D0, LOW); // This is to receive the message of the "state" on the screen Serial.println("This LED is Off"); } }