HD74LS273 Octal D-type Positive-edge-triggered Flip-Flops (with Clear)

Used Products:

1. Arduino UNO
2. HD74LS273P

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], index==i); } index++; digitalWrite(clockPin, 0); digitalWrite(clockPin, 1); delay(sleep); }