#include<reg52.h>
sbit P20 = P2^0;
sbit P21 = P2^1;
sbit CS88 = P2^2;
unsigned char code seg[]={
0xf7,0xaa, 0xdf,0xef,
};
void Delay(unsigned int t);
main()
{
unsigned char i;
P1=0x00;
P20=0;
P21=0;
CS88=0;
P1=0xFF;
while(1)
{
P1=0xFE;
for(i=0;i<8;i++)
{
Delay(15000);
P1 <<=1;
}
P1=0x7F;
for(i=8;i>1;i--)
{
Delay(15000);
P1 >>=1;
P1 |=0x80;
}
for(i=0;i<64;i++)
{
Delay(15000);
P1=seg;
}
}
}
void Delay(unsigned int t)
{
while(--t);
}
|