#include <reg51.h>
#define uchar unsigned char
#define uint unsigned int
uchar code DSY_CODE []=
{
0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0xf8,0x80,0x90,0xbf,0xff
};
uchar code DSY_IDX[]=
{
0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80
};
uchar DISP_BUFF[]={2,0,1,7,0,4,0,7};
void DelayMS(uint x)
{
uchar t;
while(x--)
{
for(t=120;t>0;t--);
}
}
void main()
{
uchar m;
P0=0xff;
while(1)
{
for(m=0;m<8;m++)
{
P2=0x00;
P0=DSY_CODE[DISP_BUFF[m]];
P2=DSY_IDX[m];
DelayMS(3);
}
}
}
#define uchar unsigned char
#define uint unsigned int
uchar code DSY_CODE []=
{
0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0xf8,0x80,0x90,0xbf,0xff
};
uchar code DSY_IDX[]=
{
0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80
};
uchar DISP_BUFF[]={2,0,1,7,0,4,0,7};
void DelayMS(uint x)
{
uchar t;
while(x--)
{
for(t=120;t>0;t--);
}
}
void main()
{
uchar m;
P0=0xff;
while(1)
{
for(m=0;m<8;m++)
{
P2=0x00;
P0=DSY_CODE[DISP_BUFF[m]];
P2=DSY_IDX[m];
DelayMS(3);
}
}
}

