#define p_alcoba 35
#define p_ba 25
#define p_sala 14
#define p_cocina 13
#define led_alcoba 21
#define led_ba 18
#define led_sala 16
#define led_cocina 2
void setup() {
pinMode(p_alcoba, INPUT);
pinMode(p_ba, INPUT);
pinMode(p_sala, INPUT);
pinMode(p_cocina, INPUT );
pinMode(led_alcoba, OUTPUT);
pinMode(led_ba, OUTPUT);
pinMode(led_sala, OUTPUT);
pinMode(led_cocina, OUTPUT);
}
void loop() {
if(digitalRead(p_alcoba) == 1){
digitalWrite(led_alcoba, HIGH);
}
else{
digitalWrite(led_alcoba, LOW);
}
if(digitalRead(p_ba) == 1){
digitalWrite(led_ba, HIGH);
}
else{
digitalWrite(led_ba, LOW);
}
if(digitalRead(p_sala) == 1){
digitalWrite(led_sala, HIGH);
}
else{
digitalWrite(led_sala, LOW);
}
if(digitalRead(p_cocina) == 1){
digitalWrite(led_cocina, HIGH);
}
else{
digitalWrite(led_cocina, LOW);
}
}