https://static.assets-stash.eet-china.com/album/old-resources/2009/5/14/d4ca6135-b75c-481a-892c-1fdf565859dd.rar#include <reg51.h>
unsigned char code tabb[]={0xC0,0xF9,0xA4,0xB0,0x99,
0x92,0x82,0xF8,0x80,0x90};
unsigned char code taba[]={0x80,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
void delay(void)
{
unsigned char i, k;
for (i=0;i<10;i++)
for(k=243;k>0;k--);
}
void yiwei ()
{
unsigned char i;
unsigned int k;
for (k=0;k<20;k++)
for (i=1;i<2;i++)
{
P2=taba ;
P0=tabb[2-i];
delay ();
P2=0x00;
}
}
void erwei ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<18;k++)
for (i=1;i<3;i++)
{
P2=taba ;
P0=tabb[3-i];
delay ();
P2=0x00;
}
}
void sanwei ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<16;k++)
for (i=1;i<4;i++)
{
P2=taba ;
P0=tabb[4-i];
delay ();
P2=0x00;
}
}
void siwei ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<14;k++)
for (i=1;i<5;i++)
{
P2=taba ;
P0=tabb[5-i];
delay ();
P2=0x00;
}
}
void wuwei ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<12;k++)
for (i=1;i<6;i++)
{
P2=taba ;
P0=tabb[6-i];
delay ();
P2=0x00;
}
}
void liuwei ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<10;k++)
for (i=1;i<7;i++)
{
P2=taba ;
P0=tabb[7-i];
delay ();
P2=0x00;
}
}
void qiwei ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<8;k++)
for (i=1;i<8;i++)
{
P2=taba ;
P0=tabb[8-i];
delay ();
P2=0x00;
}
}
void bawei ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<6;k++)
for (i=1;i<9;i++)
{
P2=taba ;
P0=tabb[9-i];
delay ();
P2=0x00;
}
}
void qiwei1 ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<8;k++)
for (i=2;i<9;i++)
{
P2=taba ;
P0=tabb[10-i];
delay ();
P2=0x00;
}
}
void liuwei1 ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<10;k++)
for (i=3;i<9;i++)
{
P2=taba ;
P0=tabb[11-i];
delay ();
P2=0x00;
}
}
void wuwei1 ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<12;k++)
for (i=4;i<9;i++)
{
P2=taba ;
P0=tabb[12-i];
delay ();
P2=0x00;
}
}
void siwei1 ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<15;k++)
for (i=5;i<9;i++)
{
P2=taba ;
P0=tabb[13-i];
delay ();
P2=0x00;
}
}
void sanwei1 ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<17;k++)
for (i=6;i<9;i++)
{
P2=taba ;
P0=tabb[14-i];
delay ();
P2=0x00;
}
}
void erwei1 ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<19;k++)
for (i=7;i<9;i++)
{
P2=taba ;
P0=tabb[15-i];
delay ();
P2=0x00;
}
}
void yiwei1 ()
{
unsigned char i,j;
unsigned int k;
for (k=0;k<21;k++)
for (i=8;i<9;i++)
{
P2=taba ;
P0=tabb[16-i];
delay ();
P2=0x00;
}
}
void main ()
{
while (1)
{
yiwei ();
erwei ();
sanwei ();
siwei ();
wuwei ();
liuwei ();
qiwei ();
bawei ();
qiwei1 ();
liuwei1 ();
wuwei1 ();
siwei1 ();
sanwei1 ();
erwei1 ();
yiwei1 ();
}
}
文章评论(0条评论)
登录后参与讨论