int dataPin = 11; //Define which pins will be used for the Shift Register control int latchPin = 8; int clockPin = 12; int byte1 = 0; //The counter for storing the byte #1 value int byte2 = 0; //The counter for storing the byte #2 value void setup() { pinMode(dataPin, OUTPUT); //Configure each IO Pin pinMode(latchPin, OUTPUT); pinMode(clockPin, OUTPUT); } void loop() { for (byte2 = 0; byte2 < 256; byte2++) //Outer Loop { for (byte1 = 0; byte1 < 256; byte1++) //Inner Loop { digitalWrite(latchPin, LOW); //Pull latch LOW to start sending data shiftOut(dataPin, clockPin, MSBFIRST, byte1); //Send the data byte 1 shiftOut(dataPin, clockPin, MSBFIRST, byte2); //Send the data byte 2 digitalWrite(latchPin, HIGH); //Pull latch HIGH to stop sending data delay(250); } } }