利用Protues制作60s计数电路
所需的元件
单片机程序
#include<>
#define uint unsigned int;
#define uchar unsigned char;
void Delay(unsigned char t);
void DelayMs(unsigned char t);
unsigned char code DuanMa[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};// 显示段码值0~9
uchar i,j;
void main()
{
while(1)
{
for(j = 0;j <= 9;j++)
{
P1 = ~DuanMa[j];
DelayMs(100);
for(i = 0;i <= 9;i++)
{
P2 = ~DuanMa[i];
DelayMs(500);
}
}
}
}
void Delay(unsigned char t)
{
while(--t);
}
void DelayMs(unsigned char t)
{
while(t--)
{
Delay(245);
Delay(245);
}
}
利用Protues制作60s计数电路 来自淘豆网www.taodocs.com转载请标明出处.