CD74HC238E High Speed CMOS Logic 3-to-8 Line Decoder/Demultiplexer Inverting and Non-Inverting

used products:

1. Arduino UNO
2. CD74HC238E

Arduino:

#define a0Pin 4 #define a1Pin 5 #define a2Pin 6 #define del 1000 int matrix[][3] = { {0,0,0}, {0,0,1}, {0,1,0}, {0,1,1}, {1,0,0}, {1,0,1}, {1,1,0}, {1,1,1} }; void setup() { pinMode(a0Pin, OUTPUT); pinMode(a1Pin, OUTPUT); pinMode(a2Pin, OUTPUT); } void loop() { for (int i = 0; i < 8; i++) { digitalWrite(a0Pin, matrix[i][0]); digitalWrite(a1Pin, matrix[i][1]); digitalWrite(a2Pin, matrix[i][2]); delay(del); } }