#include <reg52.h>
#include<intrins.h>
unsigned int j,temp,temp1;
void delay(t)
{
while(t--);
}
void main()
{
temp=0xfe;
temp1=0x7f;
while(1)
{
for(j=0;j<8;j++)
{
P1=temp;
delay(10000);
temp=_crol_(temp,1); //左移
}
for(j=0;j<16;j++) //循環右移點亮16次,即兩輪,改次數即可改輪數
{
P1=temp1;
temp1=_cror_(temp1,1); //右移
delay(10000);
}
}
} |