Skip to content

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

@Lakoja

Description

@Lakoja

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions