Page 1 of 1

digitalWrite(TRIGGER_PIN, HIGH); won't work. Pin always returns 0

Posted: Thu Oct 24, 2019 1:04 pm
by GeorgeFlorian1
Hello !

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));
Serial.println(digitalRead(TRIGGER_PIN)); will always return 0 no matter what.

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.

Re: digitalWrite(TRIGGER_PIN, HIGH); won't work. Pin always returns 0

Posted: Thu Oct 24, 2019 2:03 pm
by idahowalker
What does https://www.olimex.com/Products/IoT/ESP ... e-hardware say about their board issue?

You may find that those pins may be used for something else:
http://esp32.de/ESP32-EVB-REV-B/ESP32_EVB_REV-B.jpg

Re: digitalWrite(TRIGGER_PIN, HIGH); won't work. Pin always returns 0

Posted: Thu Oct 24, 2019 2:08 pm
by GeorgeFlorian1
idahowalker wrote:
Thu Oct 24, 2019 2:03 pm
What does https://www.olimex.com/Products/IoT/ESP ... e-hardware say about their board issue?

You may find that those pins may be used for something else:
http://esp32.de/ESP32-EVB-REV-B/ESP32_EVB_REV-B.jpg
What is their board issue ? You're telling me to ask on their forum ?

I've also been looking at the schematics and I have no idea what pin to use. They are all occupied...

Re: digitalWrite(TRIGGER_PIN, HIGH); won't work. Pin always returns 0

Posted: Thu Oct 24, 2019 10:29 pm
by idahowalker
GeorgeFlorian1 wrote:
Thu Oct 24, 2019 2:08 pm
idahowalker wrote:
Thu Oct 24, 2019 2:03 pm
What does https://www.olimex.com/Products/IoT/ESP ... e-hardware say about their board issue?

You may find that those pins may be used for something else:
http://esp32.de/ESP32-EVB-REV-B/ESP32_EVB_REV-B.jpg
What is their board issue ? You're telling me to ask on their forum ?
I am suggesting that you ask on the builder of the board forum.