在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁(yè) > 電源與新能源 > 設(shè)計(jì)應(yīng)用 > 利用MAXQ3210產(chǎn)生壓電信號(hào)

            利用MAXQ3210產(chǎn)生壓電信號(hào)

            作者: 時(shí)間:2011-04-15 來(lái)源:網(wǎng)絡(luò) 收藏
            ;; Play Middle C for one second.move LC[1], #261 ; Outer loop counter = 261 cycles (1s * 261Hz)middleC:move PO0.0, #1 ; Switch output high.move LC[0], #6839 ; Half period : (1/261Hz) / (1/3.57MHz) / 2djnz LC[0], $ ; Decrement and jump, if not zero, to current ; instruction.move PO0.0, #0 ; Switch output low.move LC[0], #6839 ; Half period : (1/261Hz) / (1/3.57MHz) / 2djnz LC[0], $ ; Decrement and jump if not zero to current ; instruction.djnz LC[1], middleC ; Decrement and jump, if not zero, to top of loop.

            通過(guò)改變循環(huán)計(jì)數(shù)器LC[0]裝載的數(shù)值來(lái)改變輸出頻率(對(duì)應(yīng)于的音符)。通過(guò)改變循環(huán)計(jì)數(shù)器LC[1]裝載的數(shù)值來(lái)改變音符持續(xù)時(shí)間。把這些代碼打包到一個(gè)簡(jiǎn)單宏中,定義幾個(gè)常數(shù),就很容易播放一小段音樂(lè)的代碼。

            本文引用地址:http://www.biyoush.com/article/179206.htm
            #define NOTE_C     261#define NOTE_C_SH  277#define NOTE_D_FL  277#define NOTE_D     294#define NOTE_D_SH  311#define NOTE_E_FL  311#define NOTE_E     330#define NOTE_F     349#define NOTE_F_SH  370#define NOTE_G_FL  370#define NOTE_G     392#define EIGHTH     1       ; 120 beats per minute, 4/4 time#define QUARTER    2       ; 120 beats per minute, 4/4 time#define QUARTERDOT 3       ; 120 beats per minute, 4/4 time#define HALF       4       ; 120 beats per minute, 4/4 time#define WHOLE      8       ; 120 beats per minute, 4/4 timeplay macro note, durationlocal L1, L2move    HRNC,  #1move    LC[1], #(note * duration / 8)L1:move    PO0.0, #1         ; Switch output high.move    LC[0], #(1785000 / note)djnz    LC[0], $          ; Decrement and jump, if not zero, to current ;    instruction.move    PO0.0, #0         ; Switch output low.move    LC[0], #(1785000 / note)djnz    LC[0], $          ; Decrement and jump, if not zero, to current ;    instruction.djnz    LC[1], L1         ; Decrement and jump, if not zero, to top of loop.move    HRNC,  #1move    LC[1], #50        ; 50ms of silenceL2:move    LC[0], #3570      ; 1ms (inner loop)  djnz    LC[0], $djnz    LC[1], L2endm
            				
                        
                            
            			
            							

            評(píng)論


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

            關(guān)閉