在單片機(jī)C語(yǔ)言中,數(shù)碼管的段碼定義了數(shù)碼管的顯示內(nèi)容,比如0~9的顯示段碼分別定義為:共陽(yáng):ucharcodeledtab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}
;//0-9共陰:ucharcodeledtab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};數(shù)碼管位碼定義了具體哪個(gè)數(shù)碼管顯示,也就是顯示數(shù)碼管的位置。比如:共8個(gè)數(shù)碼管共陽(yáng):ucharcodeWeiMa[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};共陰:ucharcodeweima[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};