Nano ESP32 S3 - dual MUX - MIDI USB - Control Surface

Hey folks,

I’m experimenting with two 4051 multiplexers using a Nano ESP32 S3 with the Control Surface library.
I would like to control one CC button with mux1 and one PBpotentiometer with mux2.

I can make one mux working with digital input (button) or analog input (potentiometer). Problem is that when I try to have both MUX's working at the same time, the button seems unresponsive.

I tried using pull-up resistors on the button but no luck.

#include <Encoder.h>
#include <Control_Surface.h>

USBMIDI_Interface midi;

using namespace MIDI_Notes;

CD74HC4051 mux1 {13, {3, 4, 11}};
CD74HC4051 mux2 {12, {3, 4, 11}};

//BUTTON
NoteButton button1 = {
   mux1.pin(1),
  {note(Ab, -1), CHANNEL_1}, // Note on MIDI channel 
};

//FADER
PBPotentiometer vol1 {
  mux2.pin(1),        // Analog pin connected to potentiometer
  CHANNEL_1, // MIDI Channel 
  };

void setup() {

RelativeCCSender::setMode(relativeCCmode::MACKIE_CONTROL_RELATIVE);

  Control_Surface.begin(); 
}

void loop() {
  Control_Surface.loop();
}

Thank you in advance.

check the comments at the top..
AnalogMultiplex.hpp
looks like you need to have separate !E lines for each mux if you are sharing the address lines..

don't quite understand your schem, but does maybe appear you have tied the 2 !E pins low??

never used this lib before, just what I noticed looking into its source..

good luck.. ~q

1 Like

Sharing address lines is also okay if you use different input pins.

Hi all,
just to give a conclusion to this post.
I managed to make it work.
The issue was related to the IDE settings again.
Boards options and settings for ESP32 are endless.
Thank you guys!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.