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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索

51單片機多路延時控制器小制作

查看數: 7548 | 評論數: 5 | 收藏 0
關燈 | 提示:支持鍵盤翻頁<-左 右->
    組圖打開中,請稍候......
發布時間: 2018-8-22 16:39

正文摘要:

設備上的除塵反吹控制器損壞,更換新的后,感覺程序不是很難,自己突發想法寫一個程序 做電工,愛好單片機,查資料開始的路走彎了很多,一直糾結在設置好后怎樣讀取數值,再循環倒計時,開始倒計時完后不知道怎樣 ...

回復

ID:867960 發表于 2021-6-26 13:53
有點復雜,,,,,,,,,,,
ID:784783 發表于 2020-6-20 10:41
哪里買的單片機
ID:89072 發表于 2018-8-22 16:43
void xsdata(uchar aa,uchar bb,uchar cc,uchar dd)//顯示函數
{
/*******       
        aa=shu/1000;
        bb=shu%1000/100;
        ********/
        aa=num%100/10;
        bb=num%10;
                       
        cc=shu%100/10;
        dd=shu%10;
               
        we1=0;
        P0=table[aa];
        delay_50ms(10);
        P0=0xff;
        we1=1;
       
        we2=0;
        P0=table[bb];
        delay_50ms(10);
        P0=0xff;
        we2=1;
       
        we3=0;
        P0=table[cc];
        delay_50ms(10);
        P0=0xff;
        we3=1;

        we4=0;
        P0=table[dd];
        delay_50ms(10);
        P0=0xff;
        we4=1;
}
ID:89072 發表于 2018-8-22 16:42
/************中斷函數****************/
void timer0() interrupt 1                //中斷函數
{
        uchar t0;
        TH0=(65536-50000)/256;
        TL0=(65536-50000)%256;
        t0++;
        if(t0==20)
        {
                t0=0;
                shu--;
                if(shu==0)
                {
                        shu=shu1;
                        num--;
                          
                        if(num==0)
                        {
                                P1<<=1;
                           P1=P1|0x01;     //左移后,最右端自動賦值0,所以需要該語句賦值1
                           if(P1==0x7f)
                           P1=0xfe;
                                num=num1;
                         }
                }
        }
}
ID:89072 發表于 2018-8-22 16:41
/************按鍵控制部分****************/
void key() //按鍵
{
                if(s1==0)
                {
                        delay_50ms(10);
                        if(s1==0)
                        {                       
                                while(!s1);
                                c1++;
                        }
                }
        if(c1==1)                  //時間設置
        {
                if(s2==0)
                {
                        delay_50ms(5);
                        if(s2==0)
                        {
                        while(!s2);
                        shu1--;
                        }
                }
                if(s3==0)
                {
                        delay_50ms(5);
                        if(s3==0)
                        {
                                 while(!s3);                       
                                 shu1++;
                         }
                }
        }
        if(c1==2)                                        //循環次數設置
        {
                if(s2==0)
                {
                        delay_50ms(5);
                        if(s2==0)
                        {
                                while(!s2);
                                num1--;
                        }
               
                }
                if(s3==0)
                {
                        delay_50ms(5);
                        if(s3==0)
                        {
                                 while(!s3);                       
                                 num1++;
                         }
                         
                }       
        }
}

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表