你说的这两个段码都是对的,是与P0与数码管接法有关:P0.0~7对应a~dp或P0.0~7对应dp~a。
//顺序共阴极数码管段码表,段码a-h顺序接PX0-PX7
unsigned char code table[]={//共阴数码管段码"0~f-."
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71,0x40,0x80};
//反序共阴极数码管段码表,段码a-h顺序接PX7-PX0
unsigned char code Table[]={//共阴数码管段码"0~f-."
0xFC,0x60,0xDA,0xF2,
0x66,0xB6,0xBE,0xE0,
0xFE,0xF6,0xEE,0x3E,
0x9C,0x7A,0x9E,0x8E,0x02,0x01};
//顺序共阳极数码管段码表,段码a-h顺序接PX0-PX7
unsigned char code table[]={//共阳数码管段码"0~f-."
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,
0xc6,0xa1,0x86,0x8e,0xbf,0x7f};
//反序共阳极数码管段码表,段码a-h顺序接PX7-PX0
unsigned char code Table[]={//共阴数码管段码"0~f-."
0x03,0x9f,0x25,0x0d,
0x99,0x49,0x41,0x1f,
0x01,0x09,0x11,0xc1,
0x63,0x85,0x61,0x71,0xfd,0xfe};
|