SN54/74LS373 Octal Transparent Latch with 3-State Outputs; Octal D-Type Flip-Flop with 3-State Output

Used Products:

1. Arduino UNO
2. SN74LS373N

Code:

int pins[] = {2,3,4,5,6,7,8,9}; int index = 0; int sleep = 100; void setup() { for (int i = 0; i < 8; i++) { pinMode(pins[i], OUTPUT); } } void loop() { for (int i = 0; i < 8; i++) { if (index >= 8) { index = 0; } digitalWrite(pins[i], index==i); } index++; delay(sleep); }