Skip to content

Incorrect ADC Readings due to 13Bit capture width as default on ESP32-S2 #4040

@Orel-A

Description

@Orel-A

What happened?

handleAnalog() function incorrectly assumes the analogRead() arduino API on ESP32-S2 will give a value between 0-4095 but in fact it's 0-8191 (13bit)

To Reproduce Bug

Expected Behavior

Install Method

Binary from WLED.me

What version of WLED?

0.15.0-b4

Which microcontroller/board are you seeing the problem on?

ESP32-S2

Relevant log/trace output

No response

Anything else?

Can be fixed with a call of analogReadResolution(12); on init code or change the divide by 16 in handleAnalog() function.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfixed in sourceThis issue is unsolved in the latest release but fixed in master

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions