/**
*
* Programa para encender un led segun el estado de un boton (Pull Up)
*
* Autor: Roberto Loaeza Valerio
* Fecha: 18/04/2023
*
**/
#define pinBoton 21
#define pinLed 32
void setup() {
pinMode(pinBoton, INPUT);
pinMode(pinLed, OUTPUT);
}
void loop() {
if(digitalRead(pinBoton) == HIGH ) {
digitalWrite(pinLed, HIGH);
}
else {
digitalWrite(pinLed, LOW);
}
delay(10); // this speeds up the simulation
}