int clockPin = 8; int latchPin = 12; int dataPin = 11; int shortDelay = 60; // Bit pattern of LEDs to light up. End it with an integer >=256 int sequence[] = { B10000000, B01000000, B00100000, B00010000, B00001000, B00000100, B00000010, B00000001, B00000010, B00000100, B00001000, B00010000, B00100000, B01000000, 256, }; void setup() { // Set out pins for output pinMode(latchPin, OUTPUT); pinMode(clockPin, OUTPUT); pinMode(dataPin, OUTPUT); } void loop() { for (int i = 0; sequence[i] < 256; i++) { // Prepare shift register for input digitalWrite(latchPin, LOW); // Send 8 bits to the shift register, least significant first shiftOut(dataPin, clockPin, LSBFIRST, sequence[i]); // Indicate we've finished sending digitalWrite(latchPin, HIGH); // Wait a little bit before the next pattern delay(shortDelay); } }