#include<reg51.h>
#define D 100
typedef unsigned int u16;
typedef unsigned char u8;
u8 code a[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
void delay(u16 i)
{
while(i--);
}
void main()
{
u16 i=0;
while(1)
{
P2=28;
while(P2>=0)
{
P0=a[i++];
delay(D);
P0=0;
P2-=4;
if(i==8)
i=0;
}
}
}
动态数码管显示
最新推荐文章于 2022-02-22 20:27:19 发布