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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 8051單片機紅外線遙控實驗

          8051單片機紅外線遙控實驗

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

          如果網(wǎng)頁顯示格式錯亂可從這里下載完整的源程序:http://www.51hei.com/f/dpjjmhw.rar
          //遙控器采用Ht6221芯片
          //紅外線遙控 用外部中斷作為紅外線解碼輸入 紅外遙控器1號鍵為電風扇啟動鍵
          #include
          #define uchar unsigned char
          #define uint unsigned int
          code uchar seg[]={0x28,0x7e,0xa2,0x62,0x74,0x61,0x21,0x7a,0x20,0x60}; //數(shù)碼管碼表
          code uchar tab[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe}; //數(shù)碼管位選
          code uchar ss[]={0x10,0x03,0x01,0x06,0x09,0x1d,0x1f,0x0d,0x19,0x1b,0x11,0x15,0x17,0x12,0x16,0x4c,0x40,0x48,0x04,0x00,
          0x02,0x05,0x54,0x4d,0x0a,0x1e,0x0e,0x1a,0x1c,0x14,0x0f,0x0c}; //紅外線鍵碼1--32
          void delay(uint k)
          {
          while(k--);
          }
          void show(uint k) //顯示數(shù)值
          {
          uchar i=0,j;
          uchar s[4]; //顯示最終位數(shù)
          do
          {
          s[i++]=k%10; //數(shù)據(jù)分離
          }while(k/=10);
          for(j=0;j {
          P0=seg[s[j]];
          P2=~(1<<(3-j));
          delay(100);
          P0=0xff;
          P2=0xff;
          }

          }
          上一頁 1 2 下一頁

          關(guān)鍵詞: 8051單片機紅外線遙

          評論


          技術(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); })();