Can't analogRead pin 19 or 22. Ugh.
Posted: Fri Jan 21, 2022 7:11 pm
Greetings!
This feels like a trivial question, but I've struggled with it for days and am completely out of ideas.
I've got some ESP32 DevkitCs from Amazon (https://smile.amazon.com/gp/product/B0718T232Z) and am testing with the Arduino IDE (set to Board: "ESP32 Dev Module"). When I analogRead GPIO pins 19 or 22 get back "0".
Here's a test run using a 1k/10k voltage divider between 3.3V and ground as input (reads 0.3V on DMM). I've connected the same input to GPIO 34 as a reference:
Here's the code:
And a pic of the wiring:
I had two boards exhibiting the same behavior, but came to the conclusion that I must have fried them somehow during prototyping. So I just bought a third board and plugged it in straight out of the package. Alas, it shows the same behavior ;(
My project involves a number of sensors, so really hate to forsake 2 inputs.
It seems almost impossible that I could have three separate boards all with the same problem. But I have exactly zero other ideas.
I'm hoping someone may have had a similar experience, or have some thoughts about what I might try next.
Thanks in advance for any ideas!
This feels like a trivial question, but I've struggled with it for days and am completely out of ideas.
I've got some ESP32 DevkitCs from Amazon (https://smile.amazon.com/gp/product/B0718T232Z) and am testing with the Arduino IDE (set to Board: "ESP32 Dev Module"). When I analogRead GPIO pins 19 or 22 get back "0".
Here's a test run using a 1k/10k voltage divider between 3.3V and ground as input (reads 0.3V on DMM). I've connected the same input to GPIO 34 as a reference:
Code: Select all
Pin 19: 0
Pin 22: 0
Pin 34: 221
Pin 19: 0
Pin 22: 0
Pin 34: 224
Pin 19: 0
Pin 22: 0
Pin 34: 222
Pin 19: 0
Pin 22: 0
Code: Select all
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.print("Pin 19: "); Serial.println(analogRead(19));
Serial.print("Pin 22: "); Serial.println(analogRead(22));
Serial.print("Pin 34: "); Serial.println(analogRead(34));
delay(1000);
}
I had two boards exhibiting the same behavior, but came to the conclusion that I must have fried them somehow during prototyping. So I just bought a third board and plugged it in straight out of the package. Alas, it shows the same behavior ;(
My project involves a number of sensors, so really hate to forsake 2 inputs.
It seems almost impossible that I could have three separate boards all with the same problem. But I have exactly zero other ideas.
I'm hoping someone may have had a similar experience, or have some thoughts about what I might try next.
Thanks in advance for any ideas!