SN74LS378N Hex D Flip-Flop with Enable

used products:

1. Arduino UNO
2. SN74LS378N

Arduino:

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