流水灯循环右移

#include
//#include
void Delay(int t)
{
	while(t--);
}
void main()
{
    unsigned int i;
	Delay(50000);
	while(1)
	{		
	    P1=0x7f;
		for(i=1;i<=8;i++)
		{
			//Delay(50000);
			P1>>=1;
			P1=_cror_(P1,1);
			P1=P1|0x80;//相当于每次对高位赋值为一
		}
	}
}

  

转载于:https://www.cnblogs.com/fengyepiaolei/archive/2011/11/18/2254530.html

你可能感兴趣的:(流水灯循环右移)