#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uint x,y;
sbit we1=P2^0;
sbit we2=P2^1;
void delay(uint a);
void main()
{
while(1)
{
P0=0xff;
we1=1;we2=0;
P0=0xF9;
delay(1);
P0=0xff;
we1=0;we2=1;
P0=0xC0;
delay(1);
}
}
void delay(uint a)
{
uint x,y;
for(x=a;x>0;x--)
for(y=125;y>0;y--);
} |