Skip to content

analogReference(INTERNAL4V096) result is 1.024V #338

Description

@ubataa

I want to use internal 4.096V reference voltage for ADC of LGT8F328P SSOP20 board in my project. I’m using platform IO in VS Code for development. Based on my findings in web I should use “analogReference(INTERNAL4V096); ” function for that. but the result is ADC Ref Voltage sets to 1.024V.
I rummaged the “wiring_analog.c” and “pins_arduino.h” files in lgt8fx framework for PlatformIO discovered the following problem in “analogReference()” function definition: they used the macro definition checking (#if defined(LGT8FX8P)) for compile time. But because of LGT8FX8P never defined, the section of code that contains correct voltage settings was skipped during compile. The MAIN PROBLEM is when I trying to define the LGT8FX8P that causes many other compiler errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions