#include <REGX52.H>
unsigned char code Seg_tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x82,0xf8,0x80,0x90};
void Delayms(unsigned char x)
{
unsigned int i,j;
for(i=0;i<x;i++)
{
for(j=0;j<120;j++);
}
}
void main()
{
unsigned char i;
while(1)
{
for(i=0;i<99;i++)
{
P0=Seg_tab[i/10];
P2=Seg_tab[i%10];
Delayms(500);
}
}
}
2位数码管静态显示
最新推荐文章于 2024-05-26 22:11:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)