8个数码管动态稳定显示 - 武恩赐博客💻

8个数码管动态稳定显示

#include<reg51.h>
void delay(unsigned int t)
{
while(t--);
}
void main()
{
unsigned char smg1[]={0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xc0,0xa4,0x99,0x99,0xc0,0xa4,0xa4,0xc0};//02440230
    unsigned char smg2[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
    int i,j,m;
    
    while(1)
    {
        for(j=0;j<8;j++)
        for(m=0;m<30;m++)
         for(i=0;i<8;i++)
        {
        P1=smg1[i+j];
        P2=smg2[i];
        delay(300);
        P1=0xff;
        }
        
    }
}
无标签
打赏
评论区
头像