Hi all.
I am making a simple project where i need to display the contains of Array to seven segment display.
for ex.
unsigned char array[4]={"1234"};
also i have four seven segment displays where i need to display 1 to segment 1, 2 to segment 2, 3 to segment 3, 4 to segment 4.
common anode segments are connected to PORT 1 of 89S52 Microcontroller.
how can i do it. can anybody provide me some logics to do it.
No need to convert to BCD, just create a second array containing the bit pattern of segments and drive the port with it directly.
hint: think of the segments as bits in the port, for example segment A = bit 0, segment B = bit 1 and so on. Then work out the bit pattern and hence numeric value for the segments you want lit for each digit.
also i have four seven segment displays where i need to display 1 to segment 1, 2 to segment 2, 3 to segment 3, 4 to segment 4
Be careful not to confuse segments and digits. A digit is the whole display module consisting of seven segments and maybe a decimal dot, a segment is the individual bar that makes up the shape of the digit.