I'm trying to use a Mux Shield in a way that it would have M0 and M1 sending analog in data over serial, and having M2 print digital data received via serial.

I'm trying to get both to work simultaneously in MaxMSP, and am wondering if it is even possible to both send and received different streams of serial data at the same time; although I had figured that if should be doing that as long as I'm not using a write function in the Arduino code. Here's my sketch so far as I've written it. Sorry if its a tad messy.

Not sure what the digital stuff is doing at the end but the way you had the analogue input bit going outputted all 16 values in the array every time you read in one value.This will result in lots of printed output and once every 16 times it will be right.

Alright, thank you, that seems to be a bit more clean. The digital stuff at the end was trying to output received serial data (from MaxMSP) out of the third multiplexer. I had it working on its own perfectly okay (ill post the code) and the problem I was running into was getting both the 2 mux arrays analog in's whilst sending the 3rd mux digital out.

The maxData (four zero's) was being tested by if statements to produce a single led HIGH on my command from incoming Serial data

OK try this. I have changed the logic so that if there is data it empties the buffer and then uses the last received readings to set the outputs. The way you had it was that the outputs were being set every time through the loop whether new data was received or not.

Thanks for the code. I'm still having issues with it working together... In fact, twisting a potentiometer hooked into one of the analog muliplexers is actually causing the led's to blink at different intensities. I'm wondering if this has something to do with the way the shield is constructed, as the analog in's all read in a voltage even is something is not connected to them, and it will vary depending on the voltage coming through an in with something connected to it. But thanks for all your help though so far Grumpy Mike!

In the truth table having no pins HIGH was labeled as sending S0, S1, S2, and S3 all x, which then would have to be defined in the arduino code, so I thought I'd just put anything that wasn't a 1 or a 0. Would there be a better way?

As far as the [digital write 16, HIGH] chuck of code, it was just turning on the correct digital out pin to then receive the maxData. Do you think this could be the thing causing the irrational behavior?

When something is marked x it means don't care, it has to be a 0 or a 1 but it has no effect on the outcome what ever. You can't set an output pin to a 2 it makes no sense, we are talking about logic levels here.

As to pin 16, if it is always an output and always high then it is better to put that bit of code in the setup(), however as it doesn't change I would not expect it to give rise to any odd behavior.

Hi all,I am bran new to Arduino having just migrated from PIC Micro-controllers.I have a UNO and was planning on building a project that displays different patterns using LED'sI got myself the MUX shield to increase the number of outputs.I was rather hoping I could also control not only how many LED'S switch on or off but also the brightness. I now realise that this shield can only be configured for analog input and not output even though the chip it is based on (CD74HC4067) is capable of analog output.I am considering modifying the shield by simply connecting the UNO's PWM outputs to the COM lines on the MUX board.The value on these outputs can then be switched to the appropriate outputs.

I have hit a major wall!It appears that the MUX shield can only switch one output at a time i.e. I can't switch several LED's on at the same time.The only way i see this possible is if the code runs fast it appears that several LED's are on at the same time.Maybe it is the way i am writing my code?

I have the code below, each channel works but in the loop it doesn't, can anybody help please?

void setup(){ //Set MUX control pins to output // these are the adressing control pins and expect a binary value 0000 to 1111 to select one of 16 channels pinMode(CONTROL0, OUTPUT); pinMode(CONTROL1, OUTPUT); pinMode(CONTROL2, OUTPUT); pinMode(CONTROL3, OUTPUT);}