M74HC155B1 Dual 2 to 4 Line Decoder 3 to 8 Line Decoder

used products:

1. Arduino UNO
2. M74HC155B1

Arduino:

#define aPin 2 #define bPin 3 #define del 500 int matrix[][2] = { {0,0}, {1,0}, {0,1}, {1,1} }; void setup() { pinMode(aPin, OUTPUT); pinMode(bPin, OUTPUT); } void loop() { for (int i = 0; i < 4; i++) { digitalWrite(aPin, matrix[i][0]); digitalWrite(bPin, matrix[i][1]); delay(del); } }