Hexadecimal Display Driver

Greetings.

I had free time, and I decided to code some fun project, then I decided to write this :

and turn my Arduino Uno R3 to a display server for Seven Segment.


P.S : I know using a 7447 is always a better idea, but it's only for fun :smiley:

"I know using a 7447 is always a better idea"
I'd disagree. First, it's obsolete. TPIC6C595 or TPIC6B595 is better, same as 74HC595 shift register but with open drain high current outputs. Just add a 10-bye font lookup array in software. And you can daisy chain a bunch of them.

byte fontArray[] = {
0b00111111, // 0 DP-g-f-e-d-c-b-a. 1 = segment on
0b00000110, // 1
//etc
};

a
f b
g
e c
d DP or colon if used

shiftOut (dataPin, clockPin, MSBFIRST, fontArray[numberToDisplay]);
or for faster updates
SPI.transfer (fontArray[numberToDisplay]);

Then you don't need a shift register in front of the 7447, and they run cooler too.
Here's a board I offer with 12 TPIC6B595 designed to drive up to 12 digits of 7-seven segment displays made with LED strips for the segments.
http://www.crossroadsfencing.com/BobuinoRev17/


A variation drives the digital Pace Clock sold here http://www.kiefer.com/

CrossRoads:
"I know using a 7447 is always a better idea"
I'd disagree. First, it's obsolete. TPIC6C595 or TPIC6B595 is better, same as 74HC595 shift register but with open drain high current outputs.

Thanks dude, I have both 7447 and 74595 IC's , and I will test both of them in action :smiley:

Now, I've updated the code, and it also can drive a common cathode display.

Now I have this code :

#define DS 7
#define ST_CP 8
#define SH_CP 9

byte digits[10] = {
  0x3f, 
  0x06, 
  0x5b,
  0x4f, 
  0x66, 
  0x6d, 
  0x7d, 
  0x07,
  0x7f,
  0x6f
};

int i;

void setup() {
  // put your setup code here, to run once:
  pinMode(DS, OUTPUT);
  pinMode(ST_CP, OUTPUT);
  pinMode(SH_CP, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
  for(i = 0; i < 10; i++){
    digitalWrite(ST_CP, LOW);
    shiftOut(DS, SH_CP, MSBFIRST, ~(digits[i]));
    digitalWrite(ST_CP, HIGH);
    delay(1000);
  }

}

Which is much better than what I've written before.

P.S : I used 74595 shift register in this case.