#include<reg51.h>
#define unit unsigned int
sbit gate1=p2^0;
sbit gate2=p2^1;
sbit gate3=p2^2;
sbit gate4=p2^3;
void main(void)
{
unit i,j;
while(1)
{
for(i=1000;i>0;i++)
for(j=1000;j>0;j++);
gate1=!gate1;
gate2=!gate2;
gate3=!gate3;
gate4=!gate4;
}
} |