欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: 51單片機(jī)使用定時(shí)器控制流水燈-分享文件 [打印本頁]

作者: !=5    時(shí)間: 2020-2-19 10:32
標(biāo)題: 51單片機(jī)使用定時(shí)器控制流水燈-分享文件
#include<reg51.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar oxfe;
uchar b,j,c,n=0,i=0,k=0,d=0;
void dsqcsh(void)
{
        TMOD |=0x01;
        TH0=0x20;
        TL0=0xD1;
        EA=1;
        ET0=1;
        TR0=1;
}
void dsqzd() interrupt 1 using 1
{
        n++;
        TH0=0x20;
        TL0=0xD1;
        if(n==2)//10ms
        {
                if(i!=7)
                {
                P2=b;
                b=_crol_(b,1);//左移
                n=0;
                i++;}
                else
                {       
          P2=b;
                b=_cror_(b,1);                //右移
                d++;
                n=0;
                        if(d==7)
                        {i=0;
                                d=0;
                        }
                }
        }

}

void delay(uchar t)
{
        while(t--);

}
void main()
{
        dsqcsh();
        b=0xfe;
        while(1);
}



1.PNG (55.52 KB, 下載次數(shù): 31)

proteus中的電路圖

proteus中的電路圖





歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1