Skip to content

Adapt for ADC resolution on ESP32Β #15

Open
@lukasfischer83

Description

@lukasfischer83

Arduino board: ESP32
Hi, I just noticed a small bug on ESP32, which has 12bit ADC resolution. The driver works as expected if analogReadResolution(10); is called before using getPoint(). Otherwhise, as expected, it does not ;).
So maybe you could implement a check on the resolution and change the calculations (1023 is hardcoded in some lines) or simply right-shift the adc results by two if ESP32 is defined.
Cheers, Lukas

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