📄 led4jd.c
字号:
#include<reg52.h>
#define uchar unsigned char
sbit P33=P3^3;
code uchar TAB1[]={
0xc0,0x3f,0x41,0x29,0x19,0x45,0x3f,0xc0,
0x7e,0x1c,0xff,0x00,0xbd,0x47,0x25,0x9d,
0xb6,0x7d,0x57,0x04,0xd3,0xaa,0xf6,0x10,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10};
code uchar TAB2[]={
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xb6,0x7d,0x57,0x04,0xd3,0xaa,0xf6,0x10,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7e,0x1c,0xff,0x00,0xbd,0x47,0x25,0x9d,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xc0,0x3f,0x41,0x29,0x19,0x45,0x3f,0xc0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xb6,0x7d,0x57,0x04,0xd3,0xaa,0xf6,0x10,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7e,0x1c,0xff,0x00,0xbd,0x47,0x25,0x9d,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xc0,0x3f,0x41,0x29,0x19,0x45,0x3f,0xc0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
char i,x[4]={0x7f,0xff,0xff,0xff};
void disp1()
{char a,d;
{for(a=0;a<32;a++)
{P1=0x00;
P33=1;
for(d=3;d>=0;d--)
{SBUF=x[d];while(!TI);TI=0;}
P1=TAB1[a];
P33=1;
for(i=0;i<4;i++)
{if((x[3]&0x01)==0)goto LP;
if((~x[i]!=0)&&((x[i]&0x01)!=0))
x[i]=x[i]<<7|x[i]>>1;
else if((~x[i]!=0)&&((x[i]&0x01)==0))
{x[i]=0xff;
x[i+1]=0x7f;
break;
}
}
}
LP:x[0]=0x7f;x[3]=0xff;
}
}
void disp2()
{int a,b,c,d;
{for(a=0;a<64;a++)
{for(b=0;b<15;b++)
{for(c=0;c<32;c++)
{P1=0x00;
P33=1;
for(d=4;d>0;d--)
{SBUF=x[d-1];while(!TI);TI=0;}
P1=TAB2[a+c];
P33=1;
for(i=0;i<4;i++)
{if((x[3]&0x01)==0)goto LP;
if((~x[i]!=0)&&((x[i]&0x01)!=0))
x[i]=x[i]<<7|x[i]>>1;
else if((~x[i]!=0)&&((x[i]&0x01)==0))
{x[i]=0xff;
x[i+1]=0x7f;
break;
}
}
}
LP:x[0]=0x7f;x[3]=0xff;
}
}
}
}
void main(void)
{while(1)
{
unsigned int j,k;
j=500;
while(j--)
{disp1();}
k=2;
while(k--)
{disp2();}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -