const int llavePin = 25;
volatile bool estadoLlave = LOW;
volatile int entradaPin;
int pinrelay = 4;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(llavePin, INPUT_PULLDOWN);
pinMode(pinrelay, OUTPUT);
// PULDOWN pone un 1 logico cuando la llave esta cerrada
Serial.println("Hello, ESP32!");
}
void loop() {
estadoLlave=digitalRead(llavePin);
digitalWrite(4, estadoLlave);
Serial.println(estadoLlave);
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}