Pages: [1]   Go Down
Author Topic: Mayhew Labs MUX (V1)  (Read 325 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

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?



Massachusetts, USA
Offline Offline
Tesla Member
Karma: 212
Posts: 8962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: