How to read stable values from potentiometers.

I've been struggling with the same problem for a long time as well. My solution was two-fold: 1) Filter the signal using a low-pass EMA filter, 2) Apply hysteresis to the filtered signal.

My MIDI Control Surface library now supports this out of the box.

If you're willing to check out the libraries, you could start here: Control Surface: Getting Started
If you don't want to use the libraries, you can check the source code and documentation here:

Pieter


Edit August 2023: update broken links