I believe this part here is the cause of your random colors:
while(micros() - startTime <= 500){
// read buttons, update array, etc
int randomnum1 = random(0, 255);
int randomnum2 = random(0, 255);
int randomnum3 = random(0, 255);
int randomnum4 = random(0, 255);
int randomnum5 = random(0, 255);
SPI.transfer(chip5[randomnum5]);
SPI.transfer(chip4[randomnum4]);
SPI.transfer(chip3[randomnum3]);
SPI.transfer(chip2[randomnum2]);
SPI.transfer(chip1[randomnum1]);
} // end while
// 'while' finally expires, the display refresh runs the next x
so for 500uS, you're writing random numbers to the shift registers.
Think you need a plan of attack here so you can see what is going on.
Try setting the chip1-5 arrays to 0 to start, then every 100 mS pick one byte in 1 array and change it.
ex.
put this in setup:
for (int i = 0; i<24; i=i+1){
chip1[i] = 0;
chip2[i] = 0;
chip3[i] = 0;
chip4[i] = 0;
chip5[i]] = 0;
}
put this before setup:
unsigned long nextUpate;
byte colortest;
put this in void loop, in place of the while random number thing:
if (millis()>nextUpdate){
nextUpdate = nextUpdate + 100;
chip1[colortest] = chip1[colortest]+1;
colortest = colortest+1;
}
Now you should see a pattern of 00000001, 00000010, 00000011, 00000100, 00000101,etc. going across the chip1 LEDs at 100mS interval, where 1 is an LED turned on.
I'm not 100% on this, still trying to get my array working, think I have some wiring issues to fix.
Moderator edit: [code] ... [/code] tags added. (Nick Gammon)