#include <reg52.h>
#include <intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar temp;
void delay()
{
uint x,y;
for(x=100;x>0;x--)
for(y=100;y>0;y--);
}
void main()
{ uint i;
temp=0xfe;
P1=temp;
for(i=8;i>=0;i--) //此处想让流水灯就流一趟停止,可是实际是一直运行,用Keil测试显示,i=2、1、0、之后就等于65536、65535...这是怎么情 请大神帮个忙,谢谢啦 {
temp=_crol_(temp,1);
delay();
P1=temp;
}
}
|