I have this code to change channels.
void setMuxChannel(byte channel) {
digitalWrite(muxS0, bitRead(channel, 0));
digitalWrite(muxS1, bitRead(channel, 1));
digitalWrite(muxS2, bitRead(channel, 2));
digitalWrite(muxS3, bitRead(channel, 3));
}
I have this code to write a value in a channels, but when I change to a new channel, the previous channel returns to LOW. I want to turn on LEDs using multiplexer, however the LEDs do not stay on since the channel they are connected to does not keep its value.
setMuxChannel(1);
digitalWrite (muxSIG,a);
delay(5);
setMuxChannel(2);
digitalWrite (muxSIG,b);
delay(5);
setMuxChannel(3);
digitalWrite (muxSIG,c);
delay(5);
setMuxChannel(4);
digitalWrite (muxSIG,d);