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);
delay(100);
}
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?
Regards
Andrew