HCF4099BE 8-Bit Addressable Latch

Used Products:

1. Arduino UNO
2. HCF4099BE

Code:

#define a0Pin 2 #define a1Pin 3 #define a2Pin 4 #define del 200 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); } }