1,040
社区成员




void timer0 () interrupt 1
{
static int count=0;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
count++;
if(count==20)
{
count=0;
time++;
if(time==20)
{
P0=0xDB;
}
else if(time==21)
{
P0=0xDF;
}
else if(time==22)
{
P0=0xDB;
}
else if(time==23)
{
P0=0xDF;
}
else if(time==24)
{
P0=0xDB;
}
else if(time==25)
{
P0=0xDF;
}
else if(time==30)
{
P0=0xFC;
}
else if(time==50)
{
P0=0xF6;
}
else if(time==51)
{
P0=0xFE;
}
else if(time==52)
{
P0=0xF6;
}
else if(time==53)
{
P0=0xFE;
}
else if(time==54)
{
P0=0xF6;
}
else if(time==55)
{
P0=0xFE;
}
else if(time==60)
{
time=0;
P0=0xCF;
}
}
}
1、数码管的显示:
2、定时器的使用:
以上为本次帖子的全部内容!