51單片機程序——數(shù)碼管顯示0~99
#define DataPort P0 //定義數(shù)據(jù)端口 程序中遇到DataPort 則用P0 替換
#define CtrlPort P1 //定義控制端口
unsigned char code DuanMa[10]={0xc0,0xf9,0xa4,0xb0, 0x99,0x92,0x82,0xf8,0x80,0x90};// 顯示段碼值0~9
unsigned char code WeiMa[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};//分別對應(yīng)相應(yīng)的數(shù)碼管點亮,即位碼
unsigned char TempData[8]; //存儲顯示值的全局變量
void Delay(unsigned int t); //函數(shù)聲明
void Display(unsigned char FirstBit,unsigned char Num);
main()
{
unsigned char num;
unsigned int j;
while(1)
{
}
}
}
void Delay(unsigned int t)
{
}
void Display(unsigned char FirstBit,unsigned char Num)
{
}
關(guān)鍵詞:
51單片機數(shù)碼管顯
評論