Hello can somebody have a look through the following code. It should be possible to control three separated 7Segment Displays with three shiftregisters. The code is working but very long and uncomfortable. Maybe someone has an example for a better solution. Suggestions are very appreciated. And the following code three times for three digits...
Thanx in advance.
regards inside-man
if (outputValue == 1){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B00000110);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 2){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01010011); //X111
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 3){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01000111);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 4){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01100110);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 5){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01101101);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 6){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01111101);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue == 7){
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B00000111);
digitalWrite(LATCH_PIN, HIGH);
}
if (outputValue ==

{
digitalWrite(LATCH_PIN, LOW);
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B01111111);
digitalWrite(LATCH_PIN, HIGH);
}