Easy question first : 1493. Do you have 4 shift registers connected together, so that the output of one feeds the input of 2, two's output feeds 3's input, etc?
If so, you can just do 4 shiftouts in a row. If not, do 4 shiftouts to the individually controlled registers. Shiftout is a software feature, pretty similar to:
digitalWrite (pin, bit0);
digitalWrite (clock low);
digitalWrite (clock, high);
//repeat 7 times for bit1, bit2, ...bit7.
You can also do a hardware controlled shiftout that would go faster using SPI, but you have to use specific pins for it. Go do some reading about it.
shiftregdata = byte1;
shiftOut(shiftdatapin, shiftclockpin, MSBFIRST, shiftregdata); // puts the bits into the input register
digitalWrite (RCK, LOW);
digitalWrite (RCK, HIGH); // puts the bits into the output register.
shiftregdata = byte2;
shiftOut(shiftdatapin, shiftclockpin, MSBFIRST, shiftregdata); // puts the bits into the input register
digitalWrite (RCK, LOW);
digitalWrite (RCK, HIGH); // puts the bits into the output register.
shiftregdata = byte3;
shiftOut(shiftdatapin, shiftclockpin, MSBFIRST, shiftregdata); // puts the bits into the input register
digitalWrite (RCK, LOW);
digitalWrite (RCK, HIGH); // puts the bits into the output register.
shiftregdata = byte4;
shiftOut(shiftdatapin, shiftclockpin, MSBFIRST, shiftregdata); // puts the bits into the input register
digitalWrite (RCK, LOW);
digitalWrite (RCK, HIGH); // puts the bits into the output register.
now, making bytex= numbers[x], maybe something like this:
shiftregdata[1] = numbers[ones_seconds];
shiftregdata[2] = numbers[tens_seconds];
shiftregdata[3] = numbers[ones_hours];
shiftregdata[4] = numbers[tens_hours];
and the 4 shifts above could be pulled into a loop? Defined as:
for (initialization; condition; increment) {
//statement(s);
}
This loop should do 4 shiftouts, fancier than anything I've tried yet:
//for (x=1 to 4)
for (x=0; x<5; x=x+1;){ //maybe x==4, and x++ instead x=x+1?? x=x+1 is clearer (to me). Try it.
shiftOut(shiftdatapin, shiftclockpin, MSBFIRST, shiftregdata[x]); // load input register
digitalWrite (RCK, LOW);
digitalWrite (RCK, HIGH); // load output register.
//Serial.writeln shiftregdata[x]; // to make sure
}