请问为什么aa定义为无符号整形就无法实现流水灯呢

2019-07-15 07:52发布

<span style="" >#include<reg52.h>
#define uint unsigned int
#define uchar unsigned  char
void delay(uint xms)
{
        uint i,j;
        for(i=xms;i>0;i--)
                for(j=110;j>0;j--);
}
void main()
{
        uint aa=0x01;
——————————————
        while(1)
        {
                P1=~aa;
                delay(200);
                aa=aa<<1;
                if(aa==0)
                aa=0x01;
        


        }
}


0条回答

一周热门 更多>