标题: 流水灯 [打印本页]

作者: xdlab    时间: 2017-5-20 12:06
标题: 流水灯
#include<reg52.h>
#include<intrins.h>
unsigned int t;
unsigned char aa;
void delay(unsigned int);
void main()
{
aa=0xfe;
while(1)
  {
        P1=aa;
        delay(500);
        aa=_crol_(aa,2);
  }
}

void delay(unsigned int t)
{
unsigned int i,j;
for(i=t;i>0;i--)
  for(j=110;j>0;j--);
}






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1