Skip to main content
Visitor II
July 8, 2024
Question

Fluctuating values read from ADC potentiometer

  • July 8, 2024
  • 1 reply
  • 1053 views

Good Day, I'm new to STM32 Programming and my project is to read ADC value from the potentiometer. However, the problem is the value displayed at the live expression is not constant. Every time I adjust the setting, the current value retrieved will show and after a second the value changes to 2438. Here is my code below: 

JGali3_0-1720419535780.png

 

    This topic has been closed for replies.

    1 reply

    Super User
    July 8, 2024

    Hi,

    you have to do calibration first ... from ds :

    AScha3_0-1720422038699.png

    +

    Put a cer.cap direct at the ADC input pin, maybe 100nF to GND. (To get a "clean" DC level here.)

    (And don't rely on live expressions , just check, what your ADC value is then, after conversion.)