4 x 7 Segment LED and shift register help
Posted: Fri May 05, 2017 9:58 am
Hello,
I'm stuck again.
I have a little board that drives 4 x 7 Segment LED's via a shift register, I know what string of bits to sent to light up the correct digit and number
but I'm stuck on how to make some sort of table up so that if I wanted to send for example, number 8 to digit 1
The bits to send could be selected from the table. Last time I did something like this I used a BCD to 7 Segment Driver and it was fairly simple.
This is the table I've used to make a crude counter to test the board but there must be an easier way.
Thanks for any assistance.
//Select digit
dig1 = 0b0000001
dig2 = 0b0000010
dig3 = 0b0000100
dig4 = 0b0001000
Select number to send
// Numbers inverted and entered
// in reverse order
b0 = NOT 0b0111111 // 0
b1 = NOT 0b0000110 // 1
b2 = NOT 0b1011011 // 2
b3 = NOT 0b1001111 // 3
b4 = NOT 0b1100110 // 4
b5 = NOT 0b1101101 // 5
b6 = NOT 0b1111101 // 6
b7 = NOT 0b0000111 // 7
b8 = NOT 0b1111111 // 8
b9 = NOT 0b1101111 // 9
I'm stuck again.
I have a little board that drives 4 x 7 Segment LED's via a shift register, I know what string of bits to sent to light up the correct digit and number
but I'm stuck on how to make some sort of table up so that if I wanted to send for example, number 8 to digit 1
The bits to send could be selected from the table. Last time I did something like this I used a BCD to 7 Segment Driver and it was fairly simple.
This is the table I've used to make a crude counter to test the board but there must be an easier way.
Thanks for any assistance.
//Select digit
dig1 = 0b0000001
dig2 = 0b0000010
dig3 = 0b0000100
dig4 = 0b0001000
Select number to send
// Numbers inverted and entered
// in reverse order
b0 = NOT 0b0111111 // 0
b1 = NOT 0b0000110 // 1
b2 = NOT 0b1011011 // 2
b3 = NOT 0b1001111 // 3
b4 = NOT 0b1100110 // 4
b5 = NOT 0b1101101 // 5
b6 = NOT 0b1111101 // 6
b7 = NOT 0b0000111 // 7
b8 = NOT 0b1111111 // 8
b9 = NOT 0b1101111 // 9