//Leer estado de un pulsador usando resistencia pull down externa
int pin = 23;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(pin, INPUT); //INPUT_PULLDOWN para usar resistencia interna del ESP32,
//perp debemos quitar todos los componentes inecesarios
}
void loop() {
// put your main code here, to run repeatedly:
int v_state = digitalRead(pin);
if (v_state == HIGH) {
Serial.println("Pulsado!!");
}
delay(100); // this speeds up the simulation
}