PieterP:
i delete the rest of the multiplexer to understand better
#include <MIDI_Controller.h>
// Create 2 instances of 'AnalogMultiplex' with the output pins of the multiplexers connected to
// analog input pin A0 and A1 respectively, and the address pins connected to pins 2, 3 and 4.
AnalogMultiplex multiplexers[] = {
{A0, { 2, 3, 4, 5 } },
};
// Create 16 new instances of the class 'Analog', on the 16 pins of the multiplexers,
// that send MIDI messages with controller 7 (channel volume) on channels 1 - 16
Analog potentiometers[] = {
{multiplexers[0].pin(0), MIDI_CC::Sound_Controller_2, 1},
{multiplexers[0].pin(1), MIDI_CC::Sound_Controller_2, 2},
};
void setup() {}
void loop() {
// Refresh the MIDI controller (check whether the potentiometer's input has changed since last time, if so, send the new value over MIDI)
MIDI_Controller.refresh();
}
thanks