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

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 數(shù)碼顯示管顯示按鍵序號(hào) 89c51單片機(jī)編程實(shí)例

          數(shù)碼顯示管顯示按鍵序號(hào) 89c51單片機(jī)編程實(shí)例

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

          題目:AT89C51單片機(jī)P1口接8個(gè)按鍵(button),P2口接1個(gè)共陰極數(shù)碼顯示管,當(dāng)有鍵按下時(shí),數(shù)碼顯示管顯示按鍵的序號(hào)

          本文引用地址:http://www.ex-cimer.com/article/201611/320747.htm

          電路圖:



          源碼如下:

          org 00h
          sjmp start
          org 30h
          start:

          mov P2,#00h
          start1:
          mov r1,#00h
          mov dptr,#table
          next:

          mov a,p1
          cpl a
          jz next
          mov r5,#1
          acall delay
          mov a,p1
          cpl a
          jz next
          clr c
          shift:

          rrc a
          jc display
          inc r1
          sjmp shift
          display:
          mov a,r1
          movc a,@a+dptr
          mov p2,a
          again:

          mov a,p1
          cpl a
          jnz again
          sjmp start1
          delay:mov r6,#50
          d1: mov r7,#100
          djnz r7,$
          djnz r6,d1
          djnz r5,delay
          ret
          table:db 3fh,06h,5bh,4fh,66h,6dh,7dh,07h
          end



          評(píng)論


          技術(shù)專(zhuān)區(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); })();