T74LS353B1 Dual 4-Input Multiplexer with 3-State Outputs

used products:

1. Arduino UNO
2. T74LS353B1

Arduino:

#define X 0 #define H 1 #define L 0 int selectPins[] = {11,12}; int i0Pins[] = {2,3,4,5}; int i1Pins[] = {6,7,8,9}; int selectPinCommands[][2] = { {L,L}, {L,L}, {H,L}, {H,L}, {L,H}, {L,H}, {H,H}, {H,H}, }; int inputCommands[][4] = { {L,X,X,X}, {H,X,X,X}, {X,L,X,X}, {X,H,X,X}, {X,X,L,X}, {X,X,H,X}, {X,X,X,L}, {X,X,X,H} }; void setup() { for (int i = 0; i < 2; i++) { pinMode(selectPins[i], OUTPUT); } for (int i = 0; i < 4; i++) { pinMode(i0Pins[i], OUTPUT); pinMode(i1Pins[i], OUTPUT); } } void loop() { for (int i = 0; i < 8; i++) { for (int d = 0; d < 4; d++) { digitalWrite(i0Pins[d], inputCommands[i][d]); digitalWrite(i1Pins[d], inputCommands[i][d]); } for (int e = 0; e < 2; e++) { digitalWrite(selectPins[e], selectPinCommands[i][e]); } delay(200); } }