int LEDpin = 8;
int BOTONpin = 12;
int BOTONlectura;
int BOTONencendido;
int BOTONapagado;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(LEDpin, OUTPUT);
pinMode(BOTONlectura, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
BOTONlectura = digitalRead(BOTONpin);
delay(100);
Serial.println(BOTONlectura);
if (BOTONlectura == 0) {
digitalWrite(LEDpin, LOW);
}
if (BOTONlectura == 1) {
digitalWrite(LEDpin, HIGH);
}
}