在单片机C语言中,数码管的段码定义了数码管的显示内容,比如0~9的显示段码分别定义为:共阳:uchar code ledtab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}
;//0-9共阴:uchar code ledtab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};数码管位码定义了具体哪个数码管显示,也就是显示数码管的位置。比如:共8个数码管共阳:uchar code WeiMa[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};共阴:uchar code weima[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};