其他分享
首页 > 其他分享> > 单片机:流水灯设计

单片机:流水灯设计

作者:互联网

#include<reg51.h>
#include<intrins.h>
void delay(unsigned int i);
void main()
{
    unsigned int x,y;
    while(1)
    {
      P1=0x7F;   
       for (x=0;x<8;x++)
        {
                delay(60000);
                P1=_cror_(P1,1); 
          }
                P1=0xFE;
             for (y=0;y<8;y++)
        { delay(60000);
                P1=_crol_(P1,1);
          
          }
       }
         }
         void delay(unsigned int i)
{
    unsigned int k;
    for (k=0;k<i;k++);
}

 

标签:main,int,void,unsigned,0x7F,单片机,流水,设计,include
来源: https://www.cnblogs.com/xkdn/p/15074723.html