#include <reg52.h>
#include <intrins.h>
void delay(unsigned char i);
unsigned char code seg[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe,0xff,0xff,0x00,0x00,0x55,0x55,0xaa,0xaa};
void main()
{
unsigned char i;
while(1)
{
P1 = 0xfe;
for(i = 0;i < 8;i++)
{
delay(50);
P1 <<= 1;
}
P1 = 0xfc;
for(i = 0;i < 4;i++)
{
delay(50);
P1 = _crol_(P1, 2);
}
P1 = 0xe7;
delay(50);
P1 = 0xdb;
delay(50);
P1 = 0xbd;
delay(50);
P1 = 0x7e;
delay(50);
for(i = 0; i < 3;i++)
{
P1 = 0x00;
delay(50);
P1 = 0xff;
delay(25);
}
for(i=0;i<16;i++)
{
delay(100);
P1=seg[i];
}
}
}
void delay(unsigned char i)
{
unsigned j , k;
for(j = 0;j < 255;j++)
for(k = 0; k < i;k++);
}
#include <intrins.h>
void delay(unsigned char i);
unsigned char code seg[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe,0xff,0xff,0x00,0x00,0x55,0x55,0xaa,0xaa};
void main()
{
unsigned char i;
while(1)
{
P1 = 0xfe;
for(i = 0;i < 8;i++)
{
delay(50);
P1 <<= 1;
}
P1 = 0xfc;
for(i = 0;i < 4;i++)
{
delay(50);
P1 = _crol_(P1, 2);
}
P1 = 0xe7;
delay(50);
P1 = 0xdb;
delay(50);
P1 = 0xbd;
delay(50);
P1 = 0x7e;
delay(50);
for(i = 0; i < 3;i++)
{
P1 = 0x00;
delay(50);
P1 = 0xff;
delay(25);
}
for(i=0;i<16;i++)
{
delay(100);
P1=seg[i];
}
}
}
void delay(unsigned char i)
{
unsigned j , k;
for(j = 0;j < 255;j++)
for(k = 0; k < i;k++);
}