Skip to content

WiFi.mode() breaks analogRead() for lower pins #1152

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

Closed
Lakoja opened this issue Feb 26, 2018 · 4 comments
Closed

WiFi.mode() breaks analogRead() for lower pins #1152

Lakoja opened this issue Feb 26, 2018 · 4 comments

Comments

@Lakoja
Copy link

Lakoja commented Feb 26, 2018

Description:

I'm trying to read (input) voltage over a voltage divider. The simplified test code is fairly simple:

int v = analogRead(voltage_pin);  
// output value
WiFi.mode(WIFI_AP);
v = analogRead(voltage_pin);
// output value

The second output is always the maximum range value (ie 4095).
The first is a reasonable expected value.

This happens only for lower pin numbers. In my design gpio 27 and lower. It does not happen for higher pins like 35.
This happens for several boards (different manufacturer) and is stable over time.

I'm a little surprised by this side-effect. Did I miss something?

@beegee-tokyo
Copy link
Contributor

Known problem.
ADC2 channel cannot be used when WiFi is in use
Solution might come from ESP-IDF sometime, but not sure.

@Lakoja
Copy link
Author

Lakoja commented Feb 26, 2018

Thanks for the reply.
Me any my luck while choosing pins for tasks. :-)

I have now a fly-wire to pin 34...

@copercini
Copy link
Contributor

I will close this issue to concentrate it at #102

It looks like a fix will come soon =)

@Meliox
Copy link

Meliox commented May 13, 2018

Both issues are closed, but it has not been fixed as of today in arduino-esp32... Has it been fixed other places, or?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants