<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > PROTUS仿真51單片機(jī)測(cè)頻程序

          PROTUS仿真51單片機(jī)測(cè)頻程序

          作者: 時(shí)間:2016-11-30 來(lái)源:網(wǎng)絡(luò) 收藏

          void main()
          {
          lcd_init();
          EA=1;
          PT1=1;
          time=0;
          TMOD=0X51;
          TH0=(65535-20000)/256;
          TL0=(65535-20000)%256;

          TH1=0;
          TL1=0;
          while(1)
          {
          shift=0;
          TH0=(65535-20000)/256;
          TL0=(65535-20000)%256;
          ET0=1;
          TR0=1;
          TH1=0;
          TL1=0;
          TR1=1;
          while(time!=25);
          ET0=0;
          TR0=0;
          TR1=0;
          time=0;
          num=(TH1*256+TL1)*2;
          TH1=0;
          TL1=0;
          qian=num%10000/1000;
          bai=num%1000/100;
          shi=num%100/10;
          ge=num%10;

          lcd_1602xy(1,0,qian+0x30);
          lcd_1602xy(1,1,bai+0x30);
          lcd_1602xy(1,2,shi+0x30);
          lcd_1602xy(1,3,ge+0x30);
          lcd_1602xy(1,4,H);
          lcd_1602xy(1,5,Z);

          shift=1;
          TH0=(65535-20000)/256;
          TL0=(65535-20000)%256;
          ET0=1;
          TR0=1;
          TH1=0;
          TL1=0;
          TR1=1;

          while(time!=25);
          ET0=0;
          TR0=0;
          TR1=0;
          time=0;
          num=(TH1*256+TL1)*2;
          TH1=0;
          TL1=0;
          qian=num%10000/1000;
          bai=num%1000/100;
          shi=num%100/10;
          ge=num%10;

          lcd_1602xy(2,0,qian+0x30);
          lcd_1602xy(2,1,bai+0x30);
          lcd_1602xy(2,2,shi+0x30);
          lcd_1602xy(2,3,ge+0x30);
          lcd_1602xy(2,4,H);
          lcd_1602xy(2,5,Z);


          }
          }
          void time0() interrupt 1
          {
          TH0=(65535-20000)/256;
          TL0=(65535-20000)%256;
          time++;
          }

          PTOTEUS仿真結(jié)果如下:


          上一頁(yè) 1 2 下一頁(yè)

          評(píng)論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();