Cd4051 Multiplexer Tutorial Is Here!

If I remember correctly, you may have to ground the S2 pin even if it’s unneeded (you only need to switch around the 2 selector pins for 4 total inputs). I think that’s why, in this tutorial, I connected a digital pin to it even though I’m only using 4 potentiometers. So, I believe you need to either connect that pin to ground or add another digital pin for the third selector pin (and also configure it in code).

And this thread could be a helpful reference to you as well: MUX on Patch SM.