数字显示00-59秒计时器

[10-10 20:38:44]   来源:http://www.88dzw.com  电子制作   阅读:8137

文章摘要:END7. C语言源程序#include <AT89X51.H>unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};unsigned char Second;void delay1s(void){unsigned char i,j,k;for(k=100;k>0;k--)for(i=20;i>0;i--)for(j=248;j>0;j--);}void main(void){Second=0;P0=table[Second/10];P2=table[Secon

数字显示00-59秒计时器,标签:电子小制作,http://www.88dzw.com
END
7. C语言源程序
#include <AT89X51.H>
unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,
0x6d,0x7d,0x07,0x7f,0x6f};
unsigned char Second;

void delay1s(void)
{
unsigned char i,j,k;
for(k=100;k>0;k--)
for(i=20;i>0;i--)
for(j=248;j>0;j--);
}


void main(void)
{
Second=0;
P0=table[Second/10];
P2=table[Second%10];
while(1)
{
delay1s();
Second++;
if(Second==60)
{
Second=0;
}
P0=table[Second/10];
P2=table[Second%10];
}
}

上一页  [1] [2] 


Tag:电子制作电子小制作维修教程知识 - 电子制作