#include "reg52.h"
sbit SIGNAL1 = P1^0;
sbit SIGNAL2 = P1^1;
sbit SIGNAL3 = P1^2;
sbit SIGNAL4 = P1^3;
void delay_ms(int x)
{
int i,j;
for(i=0;i<x;i++)
for(j=0;j<120;j++);
}
void main()
{
int time=0;
SIGNAL1=1;
SIGNAL2=1;
SIGNAL3=1;
SIGNAL4=1;
while(1)
{
if(time%50==0)
SIGNAL1=!SIGNAL1;
if(time%200==0)
SIGNAL2=!SIGNAL2;
if(time%400==0)
SIGNAL3=!SIGNAL3;
if(time%800==0)
{
time=0;
SIGNAL4=!SIGNAL4;
}
delay_ms(10);
time++;
}
}