Trouble Multiplexing

Hello to all,
first time writing here.
First of all, my deepest thank you to all developers and contributors of this fantastic IDE, when I found out about XOD I almost had tears in my eyes, what a fantastic time to live in…

Now to the problem.
I am building a MIDI controller, 16 pressure sensitive pads, (each with two sets of colored LEDs), 16 pots and 8 buttons. I am running UBUNTU 18.04 and XOD V0.33.0
I am planning on using an ARDUINO PRO MICRO and 4 74HC4067 multiplexers to read analog values and light up the LEDs.
I am using the cesars/4067 version 3.0.10 library to do that.
First issue:
when I download the library, errors show up regarding pins not been found.

So I tried to modify it the best way I can (by the way I am just starting to get to grips with all this programming business), but I cannot show you because of one image limit(???).
If I tweak the input for the channel selection everything works great.
But if I try to implement any kind of counter to cycle through the channels, all kind of weird stuff starts to happen.
It seems to me that the values get carried over from one channel to the next, and if I increase the frequency of the cycling, Channel 0 takes over and and the others are either ignored or have the same value of Channel0.

I have been trying to figure it out for a few days now, and I don’t know what else to try…
If anybody has any inputs on this, it would be greatly appreciated.
I am sure people are using multiplexers with XOD, but I can’t seem to find any information on this. Any push in the right direction is more than welcome, my 2 years old cannot wait to play with this music and light box…
Best to all

Sorry I will post pictures in the replies if I can

By changing the error detection system, the library was out of date.
Fixed in cesars/4067@3.0.12

Hi Cesars,
thanks for the quick reply.
the update indeed works out of the box.
however I am having problems implementing your library, most probably due to my noobness…
if i update the count with a slow rate, the LEDs come on one after the other, with a noticeable time off.
If I increase the rate the LED flicker randomly and the intensity of all of them is only controlled by the pot connected to channel 0.
can you please have a look at my patch and see what I did wrong?


thank you

in IN you only need to enter an int value, if it doesn’t have an int value use floor. IN is the selector so it must be 0,1,2,3,4…15

I replaced the counter with a count node


It works much better, but still the flickering is very noticeable and there is evident bleeding of the values.
Is there any way I can overcome this issues? it seems to me something is running out of sync with each other.
thank you again

I do not understand what you want to do, if you send a sketch it would be easier, I think you are not using the nodes correctly.

yes, I also think I am doing something wrong.
but what I am trying to do is actually pretty basic if it wasn’t for the multiplexing.
I have two pots connected to one multiplexer and two LEDs connected to another multiplexer.
I am trying to control the individual brightness of both the LEDs simultaneously, and I would like them to be lit without flickering


I hope it makes sense…

ok, to start delete led node or select a different port D10.

If you only have 2 outputs, you don’t need to go to 16, reset the counter to 2.

If I remember correctly, the minimum pulse is 0.02.

at 0.02 I get way too much flickering.


with this I get the best results so far, a little flickering and bleeding, but it’s barely noticeable.
I will go ahead and continue building the project, meanwhile I will look around to see what might be the cause of the problem, to try and improve on this.
thank you so much for your help

UDPs can be updated via pulse-on-change from CLOCK instead of using Loop

I think the problem is due to ghosting between pins on the multiplexer.
If I remove the pots and just input a constant value of the brightness, the LEDs still flicker and bleed to each other. I am thinking if I could switch between channels that are not next to each other phisically, so say count 1-4-8-12-0-2-5-9-13-3-7-11-15-1… maybe that would help, I have to figure out how to do that.
Also I am reading about physically trying to solve the problem on the board.
I will let you know how I get on

Connect the DONE pin of read to the UPD pin of write, maybe that will help

So I think I solved the ghosting by using the nth node


but the flickering got much worse.
basically the LEDs are blinking very fast, and no matter how I try to control the counter, I cannot get a rate of update that can give good results…
Is there a limit how fast this multiplexer switches?
Or is there something inbuilt in the library that limits the update rate maybe…
I don’t know what else to think, I see people doing the same thing with the normal Arduino IDE and they don’t experience these problems lighting leds with multiplexers.

In read-4067 update UPD using pulse-on-change taking the num value of IN.