I am trying to use a GPIO from the ESP32-EVB. I have tried using GPIO 21 and 23 and this simple code:
Code: Select all
#define TRIGGER_PIN 21
// #define TRIGGER_PIN 23
pinMode(TRIGGER_PIN, INPUT_PULLUP);
digitalWrite(TRIGGER_PIN, HIGH);
Serial.println(digitalRead(TRIGGER_PIN));
I have also tried the same thing on an ESP32 DevKitV4 and on this one, Serial.println(digitalRead(TRIGGER_PIN)); returns 1 and hooking it up to GND returns 0, which is the normal behavior.
What is the difference between the two boards ?
I believe that the ESP32 DevKitV4 has an internal resistor and the ESP32-EVB does not. And I think I need to add a resistor there somewhere. And what value should the resistor have ?
What do you think ?
EDIT
I have literally put a 10k resistor from +5V to the pin and it still returns 0.