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

Used Products:

1. CD74HC374E
2. SN74LS374N

Code:

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