Go Down

Topic: Mayhew Labs MUX (V1) (Read 404 times) previous topic - next topic


Hello Group,
I have a Mayhew Labs MuxShield V1.  I would like to select a number of LEDs in a pattern.  What I thought would work, would be to select an individual pin Reference number, then set that pin to HIGH and cycle to the next one.

The following Code was meant to light pins 8 to 15 sequentially, leaving the previous LED lit when the next one lights up.

Code: [Select]
for (int i=8; i <16; i++)
    digitalWrite(CONTROL0, (i&15)>>3); //S3
    digitalWrite(CONTROL1, (i&7)>>2);  //S2
    digitalWrite(CONTROL2, (i&3)>>1);  //S1
    digitalWrite(CONTROL3, (i&1));     //S0

    digitalWrite(16, HIGH);

What actually happens is that each individual LED lights up then goes blank when the next one comes on.  What am I doing wrong, or is this a limitation of the MUX Shield?




The analog multiplexers only connect one input/output at a time to your input/output pin.  The rest are disconnected.  This works well for inputs but not well at all for outputs.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131