|
I have a value in my counter, I want to read it out, I don't know how to do it.
Such as,
tcount = + (TH0 * 256 + TL0);
Then display
unsigned int g1, g2, g3;
dispbuf [0] = tcount / 1000;
g1 = tcount% 1000;
dispbuf [1] = g1 / 100;
g2 = g1% 100;
dispbuf [2] = g2 / 10;
g3 = g2% 10;
dispbuf [3] = g3;
P0 = dispcode [dispbuf [dispbitcnt]];
P2 = dispbitcode [dispbitcnt];
dispbitcnt ++;
if (dispbitcnt == 4)
{
dispbitcnt = 0;
}
I tried a few times, but it turned out to be wrong. I want to show how to write the lowest two digits of TH0 and the highest two digits of TL0? |
|