I wanted to update this post with my most recent code for any other beginners who might read this in the future. This was the smallest I could make it. I also changed out the uno to a nano. The answer to my question of how I could increment the other digits was found with nested for loops. I never knew this was a thing. After realising this, I was able to study the uses of nested for loops. I tried using various methods including millis() before I found the simple solution. I hope this helps some beginner one day.
#define dataPin 3
#define latchPin 4
#define clockPin 5
#define delayTime 500
byte digits[10]{129,243,73,97,51,37,5,241,1,33};
void setup() {
pinMode(latchPin,OUTPUT);
pinMode(dataPin,OUTPUT);
pinMode(clockPin,OUTPUT);
}
void loop() {
for (int l=0; l<=9; l++){
for (int k=0; k<=9; k++){
for (int j=0; j<=9; j++){
for (int i=0; i<=9; i++){
digitalWrite(latchPin,LOW);
shiftOut(dataPin,clockPin,MSBFIRST,digits[i]);
shiftOut(dataPin,clockPin,MSBFIRST,digits[j]);
shiftOut(dataPin,clockPin,MSBFIRST,digits[k]);
shiftOut(dataPin,clockPin,MSBFIRST,digits[l]);
digitalWrite(latchPin,HIGH);
delay(delayTime);
}
}
}
}
}
