# Beginner Here: How do I get my multiplexers to work?

**URL:** <https://forum.arduino.cc/t/beginner-here-how-do-i-get-my-multiplexers-to-work/1394867>\
**Category:** Audio\
**Created:** [July 10, 2025, 4:10pm UTC](https://forum.arduino.cc/t/beginner-here-how-do-i-get-my-multiplexers-to-work/1394867 "2025-07-10T16:10:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugtrain](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/hugtrain/32/1211544_2.png) [@hugtrain](https://forum.arduino.cc/u/hugtrain)\
**Post date:** [July 10, 2025, 4:10pm UTC](https://forum.arduino.cc/t/beginner-here-how-do-i-get-my-multiplexers-to-work/1394867/1 "2025-07-10T16:10:36Z")

</div>

Here is my setup for converting an old electric organ into a midi controller. The last time I did anything with arduino was years ago at some computing day camp.

Below is the fritzing diagram that I made that shows how I have it wired up. I tried this setup without the multiplexer earlier, just attachting the leads to the analog pins and the ground rail to ground, and it worked perfectly (although with a noticable lag).

Now I can't seem to get a response from the MUX at all. I've tried taking all of the wires out and putting them back in multiple times, I swapped my headers for the boards. What am I doing wrong?

The only thing I can think of is that the headers may be loose. I salvaged a couple of them from the organ because I ran out of new ones.

Here is my fritzting diagram

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/4/1/a/41aaaeea4e2f42039721c9e60c804333cefd5f43.png)

and here is my code:

```arduino
const int muxS0 = 0;
const int muxS1 = 1;
const int muxS2 = 2;
const int muxS3 = 3;

const int muxSIG = A1;

const int numKeys = 15;    
const int baseNote = 39;    

bool lastState[numKeys];    

void setup() {

  pinMode(muxS0, OUTPUT);
  pinMode(muxS1, OUTPUT);
  pinMode(muxS2, OUTPUT);
  pinMode(muxS3, OUTPUT);
  pinMode(muxSIG, INPUT_PULLUP);

  usbMIDI.begin();
}

void selectMuxChannel(int channel) {

  digitalWrite(muxS0, bitRead(channel, 0));
  digitalWrite(muxS1, bitRead(channel, 1));
  digitalWrite(muxS2, bitRead(channel, 2));
  digitalWrite(muxS3, bitRead(channel, 3));
}

void loop() {
  for (int ch = 0; ch < numKeys; ch++) {
    int muxChannel = numKeys - 1 - ch;
    selectMuxChannel(muxChannel);
    delayMicroseconds(5);  

    bool isPressed = digitalRead(muxSIG) == LOW;

    if (isPressed && !lastState[ch]) {
      usbMIDI.sendNoteOn(baseNote + ch, 127, 1); 
    } else if (!isPressed && lastState[ch]) {
      usbMIDI.sendNoteOff(baseNote + ch, 0, 1);
    }

    lastState[ch] = isPressed;
  }
  delay(1);
}

```

Here are some other pictures

 ![20250710_122129](https://europe1.discourse-cdn.com/arduino/original/4X/f/7/4/f747a7049239723ea7053273347be9acb38dacef.jpeg)  
 ![20250710_122128](https://europe1.discourse-cdn.com/arduino/original/4X/b/7/9/b791882a8dc54b985a30b9c8ace59445f68ec4b9.jpeg)  
 ![20250710_122210](https://europe1.discourse-cdn.com/arduino/original/4X/2/2/6/226bc6e739bb19a5502453b6704ae390efe26b1d.jpeg)

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [July 10, 2025, 4:19pm UTC](https://forum.arduino.cc/t/beginner-here-how-do-i-get-my-multiplexers-to-work/1394867/2 "2025-07-10T16:19:27Z")

</div>

> [@hugtrain](#):
>
> headers may be loose.

Are they soldered to the MUX board?

---

<div class="post-metadata">

**Author:** ![hugtrain](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/hugtrain/32/1211544_2.png) [@hugtrain](https://forum.arduino.cc/u/hugtrain)\
**Post date:** [July 10, 2025, 4:25pm UTC](https://forum.arduino.cc/t/beginner-here-how-do-i-get-my-multiplexers-to-work/1394867/3 "2025-07-10T16:25:10Z")

</div>

😐 No... they are not

Maybe I should have started with that 😵‍💫

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [July 10, 2025, 4:26pm UTC](https://forum.arduino.cc/t/beginner-here-how-do-i-get-my-multiplexers-to-work/1394867/4 "2025-07-10T16:26:54Z")

</div>

> [@hugtrain](#):
>
> Maybe I should have started with that

That is your problem.

They **must** be soldered.

---

<div class="post-metadata">

**Author:** ![hugtrain](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/hugtrain/32/1211544_2.png) [@hugtrain](https://forum.arduino.cc/u/hugtrain)\
**Post date:** [July 10, 2025, 4:37pm UTC](https://forum.arduino.cc/t/beginner-here-how-do-i-get-my-multiplexers-to-work/1394867/5 "2025-07-10T16:37:34Z")

</div>

Yup, that makes sense lol.

Thanks!

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [July 10, 2025, 4:47pm UTC](https://forum.arduino.cc/t/beginner-here-how-do-i-get-my-multiplexers-to-work/1394867/6 "2025-07-10T16:47:12Z")

</div>

That particular problem cones up quite a bit on the forum

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 6, 2026, 4:47pm UTC](https://forum.arduino.cc/t/beginner-here-how-do-i-get-my-multiplexers-to-work/1394867/7 "2026-01-06T16:47:36Z")

</div>

Closed on January 6, 2026, 4:47pm UTC

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