// Setting up pins D0 and D1
void setup() {
pinMode(D0, OUTPUT); // sets pin D0 as an output
pinMode(D1, INPUT); // sets pin D1 as an input
}
// Main program loop
void loop() {
estado = digitalRead(D1); // reads the state of pin D1 and stores it in 'estado'
if (estado == HIGH) {
digitalWrite(D0, HIGH); // sets pin D0 HIGH if the state of D1 is HIGH
} else {
digitalWrite(D0, LOW); // sets pin D0 LOW if the state of D1 is not HIGH
}
}