#include <REGX52.H>
#include <intrins.h>
//跑马灯
//循环移位函数
//a=0xa5 1010 0101
//b=_crol_(a,3) 0010 1101
//b=0x2d
void Delayms(unsigned int x)
{
unsigned int i,j;
for(i=0;i<x;i++)
{
for(j=0;j<124;j++);
}
}
void main()
{
unsigned int i;
while(1)
{
P1=0xfe;
for(i=0;i<8;i++)
{
Delayms(100);
P1=_crol_(P1,1);
}
}
}
流水灯循环移位函数
于 2024-04-16 20:58:05 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)