Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digitalRead gets stuck on 0 once analogRead is called on the pin #10928

Closed
1 task done
thegoodhen opened this issue Feb 1, 2025 · 1 comment
Closed
1 task done

digitalRead gets stuck on 0 once analogRead is called on the pin #10928

thegoodhen opened this issue Feb 1, 2025 · 1 comment
Labels
Status: Awaiting triage Issue is waiting for triage

Comments

@thegoodhen
Copy link

Board

Custom ESP32S3 board

Device Description

A button (but issue can be replicated with just a pullup)

Hardware Configuration

Pullup connected to pin 3.

Version

latest master (checkout manually)

IDE Name

Arduino IDE

Operating System

Windows 10

Flash frequency

N/A

PSRAM enabled

yes

Upload speed

926000

Description

I reported this before, but it was closed, despite being a bug. I am unable to reopen the issue, so I made a new one.

Original issue: #10927
I expect to be able to read correct values using digitalRead, even after calling analogRead.

The example sketch should print:
4095
1
4095
1
4095
1
...

But prints

4095
0
4095
0
4095
0

After even a single call to analogRead, all subsequent calls to digitalRead return 0, even if the pin is pulled up. Tested with multiple pins.

Sketch

void setup() {
// put your setup code here, to run once:
pinMode(3, INPUT);
Serial.begin(115200);
}

void loop() {
// put your main code here, to run repeatedly:
Serial.println(analogRead(3));
delay(100);

Serial.println(digitalRead(3));
delay(100);
}

Debug Message

17:29:01.484 -> 0
17:29:01.580 -> 4095
17:29:01.678 -> 0
17:29:01.774 -> 4095
17:29:01.905 -> 0
17:29:02.002 -> 4095
17:29:02.098 -> 0
17:29:02.195 -> 4095
17:29:02.291 -> 0
17:29:02.388 -> 4095
17:29:02.485 -> 0
17:29:02.582 -> 4095
17:29:02.678 -> 0
17:29:02.774 -> 4095
17:29:02.902 -> 0

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@thegoodhen thegoodhen added the Status: Awaiting triage Issue is waiting for triage label Feb 1, 2025
@me-no-dev
Copy link
Member

Please do not open a new issue. I have responded to your previous one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

No branches or pull requests

2 participants