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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 花樣流水燈的設(shè)計1(單片機-匯編)

          花樣流水燈的設(shè)計1(單片機-匯編)

          作者: 時間:2016-11-29 來源:網(wǎng)絡(luò) 收藏
          ;This program will show you cycle glitter between 8 led lamps
          ; maker:Chen Weiwu
          ; date:2012-11-08
          ; version:1.0.0
          ;-------------------------------------------------------------
          ;Define
          Ledprt equ p0
          SegDisPlay equ p2
          L1 equ 30h
          l3 equ 32h
          button1 equ p1.0
          button2 equ p1.2
          button3 equ p1.4
          button4 equ p1.6
          ;----------------------
          ;Set the initiation address which the program runing
          ;----------------------
          org 0
          ajmp main
          ;----------------------
          Pattern1:
          mov a,#11111110B
          Cycle1: mov Ledprt,a
          rl a
          acall delay
          jnb button1,cycle1
          mov Ledprt,#11111111B
          ret
          ;-----------------------
          Pattern2:
          mov a,#01111111B
          mov l1,#00000001B
          Cycle2: mov l3,a
          xrl a,l1
          mov Ledprt,a
          mov a,l3
          rl a
          mov l3,a
          mov a,l1
          rr a
          mov l1,a
          mov a,l3
          acall delay
          jnb button2,cycle2
          mov Ledprt,#11111111B
          ret
          ;-----------------------
          Pattern3:
          mov a,#10101010B
          Cycle3: mov l1,a
          mov Ledprt,a
          acall delay
          mov a,#11111111B
          mov Ledprt,a
          acall delay
          mov a,l1
          rl a
          jnb button3,cycle3
          mov Ledprt,#11111111B
          ret
          ;-----------------------
          Pattern4:
          mov a,#11111110B
          mov l1,#00000001B
          Cycle4: mov Ledprt,a
          acall delay
          rl a
          xrl a,l1
          jnb button4,cycle4
          mov Ledprt,#11111111B
          ret
          ;-----------------------
          ;-----------------------
          ;delay section
          delay: mov r5,#50
          delay1: mov r6,#100
          DELAY2: mov r7,#10
          djnz r7,$
          djnz r6,delay2
          djnz r5,delay1
          ret
          ;-----------------------
          main: mov SegDisPlay,#00H
          jb button1,To2
          mov SegDisPlay,#01H
          Acall Pattern1
          To2:
          jb button2,To3
          mov SegDisPlay,#02H
          Acall Pattern2
          To3:
          jb button3,To4
          mov SegDisPlay,#03H
          Acall Pattern3
          To4:
          jb button4,main
          mov SegDisPlay,#04H
          Acall Pattern4
          ajmp Main
          ;-----------------------
          end
          ;-------------------------------------------------------------


          關(guān)鍵詞: 花樣流水燈單片機匯

          評論


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