|
做的流水灯程序,要求从右到做两次就停下来,可是不行?
[复制链接]
#include
#include
#define uint unsigned int
#define uchar unsigned char
uchar temp,b;
void delay(uint z);
void main()
{
temp=0xfe;
P2=temp;
b=1;
for(b=1;b>18;b++)
while(1)
{
temp=_crol_(temp,1);
delay(9);
P2=temp;
b++;
if(b>16)
break;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=14000;y>0;y--);
}
|
|