//共阴极: 位选为低电平(即0)选中数码管, 各段选为高电平(即1接+5V时)选中各数码段(0~f)
//共阴数码管段选表,无小数点:
unsigned char code distab[16] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d, 0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
//共阴数码管段选表,有小数点:
unsigned char code distab[16] = {0xbf,0x86,0xdb,0xcf,0xe6,0xed,0xfd, 0x87,0xff,0xef,0xf7,0xfc,0xb9,0xde,0xf9,0xf1};
//共阴数码管位选表-8个
unsigned char code distab[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdF,0xbF,0x7F};//位选
/*******************************************************************************************************************/
//共阳极: 位选为高电平(即1)选中数码管, 各段选为低电平(即0接地时)选中各数码段(0~f)
//共阳数码管段选码表,无小数点:
unsigned char code distab[16]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8, 0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};
//共阳数码管段选码表,有小数点:
unsigned char code distab[16]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78, 0x00,0x10,0x08,0x03,0x46,0x21,0x06,0x0e};
//共阳数码管位选表-8个
unsigned char code distab[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};//位选