#include <reg52.h>
//#include "stc.h"
sbit led0 = P1^0;
sbit led1 = P1^1;
void dealy(void);
void main(void)
{
unsigned char i,temp = 0x01;
while(1)
{
for(i=0;i<3; i++)
{
led0 = 1;
dealy();
led0 = 0;
dealy();
}
for(i=0;i<3; i++)
{
led1 = 1;
dealy();
led1 = 0;
dealy();
}
}
}
void dealy(void)
{
unsigned j = 10,i = 8000;
while(i--)
{
while(j--)
{}
}
}
去掉这个 while(j--)
{}就亮啦这是为什么
|