Home > other >  Running water light
Running water light

Time:10-10

#include
#include
Typedef unsigned char u8;
Typedef unsigned int under-16;
# define led P2

Void delay (under-16 I)
{
While (I -);

}
Void main ()
{
U8 I=0;
Led=0 xfe;
Delay (50000);
While (1)
{
for(i=0; i<7. I++)
{
Led, led=_crol_ (1);
Delay (50000);
}
for(i=0; i<7. I++)
{
Led, led=_cror_ (1);
Delay (50000);
}
}


}

CodePudding user response:

With all due respect, this kind of thing to do?

CodePudding user response:

What's the problem? ! The code can be optimized.

CodePudding user response:

Use timer is better

CodePudding user response:

Delay (50000); CPU card, basic can't do other, waste

CodePudding user response:

First of all, don't know what you want to ask what is the problem? Moreover, the program compilation should be no problem,
Tip: delay in the program (50000); A bit of a waste of resources, _crol_ (), the delay () function if it is placed behind the main function need to declare, the main function in front of her is nothing

CodePudding user response:

  • Related