標(biāo)題:
利用51單片機(jī)實(shí)現(xiàn)秒表功能(靜態(tài)數(shù)碼管顯示)程序
[打印本頁]
作者:
軒轅頂托
時間:
2021-7-20 09:03
標(biāo)題:
利用51單片機(jī)實(shí)現(xiàn)秒表功能(靜態(tài)數(shù)碼管顯示)程序
#include <reg51.h>
#define uint unsigned int
#define uchar unsigned char
uchar code smgduan[17]={0x3f,0x06,0x5b,0x4f,0x66,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
uchar n=0;
uint i;
void main()
{
TMOD|=0X20;
TH1=0Xce;
TL1=0Xce;
ET1=1;
EA=1;
TR1=1;
while(1);
}
void Timer1() interrupt 3
{
i++;
if(i==20000)
{
i=0;
P0=~smgduan[n++];
if(n==10)
{
n=0;
}
}
}
復(fù)制代碼
作者:
kscheang
時間:
2021-12-31 18:56
第04行漏了5字這個碼
uchar code smgduan[16]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1