程序如下;
#include<reg52.h>
sbit LED=P1^0;
void delay(unsigned int t);
void main()
{
int i,j;
while(1)
{
for(i=0;i<=10;i++)
{
LED=1;
delay(5000);
LED=0;
delay(5000);
}
for(j=0;j<=10;j++)
{
LED=1;
delay(10000);
LED=0;
delay(10000);
}
}
}
void delay(unsigned int t)
{
while(t--);
}