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

GeorgeFlorian1
Posts: 160
Joined: Thu Jan 31, 2019 2:32 pm

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

Postby GeorgeFlorian1 » Thu Oct 24, 2019 1:04 pm

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.

idahowalker
Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

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

Postby idahowalker » 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

GeorgeFlorian1
Posts: 160
Joined: Thu Jan 31, 2019 2:32 pm

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

Postby GeorgeFlorian1 » 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've also been looking at the schematics and I have no idea what pin to use. They are all occupied...

idahowalker
Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

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

Postby idahowalker » Thu Oct 24, 2019 10:29 pm

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.

Who is online

Users browsing this forum: No registered users and 86 guests