Hi everyone!
I'm new to PIC programming and kind of stuck on a little problem.
I have written a code that adds or subtracts number from each other and then outputs the result to PortC. The output number ranges from 0 - 99.
However PORTC is connected to a 7 - segment HEX display. So for example if I output the number 99 (decimal) to PortC the 7 segment will only display 0x63... i need to do this with any number from 0 -99 decimal.
I've been trying to figure out a way of getting around this but no result so far...
I have had two ideas (i.e subtracting .10 then incrementing a register and loading the nibbles in PORTC) The other idea was to make a lookup table with 99 entries... but that seems a bit silly and not exactly very "elegant"
I hope someone here has an idea.
cheers!
I'm new to PIC programming and kind of stuck on a little problem.
I have written a code that adds or subtracts number from each other and then outputs the result to PortC. The output number ranges from 0 - 99.
However PORTC is connected to a 7 - segment HEX display. So for example if I output the number 99 (decimal) to PortC the 7 segment will only display 0x63... i need to do this with any number from 0 -99 decimal.
I've been trying to figure out a way of getting around this but no result so far...
I have had two ideas (i.e subtracting .10 then incrementing a register and loading the nibbles in PORTC) The other idea was to make a lookup table with 99 entries... but that seems a bit silly and not exactly very "elegant"
I hope someone here has an idea.
cheers!