中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 單片機(jī)C語言程序設(shè)計:演奏音階

        單片機(jī)C語言程序設(shè)計:演奏音階

        作者: 時間:2013-08-31 來源:網(wǎng)絡(luò) 收藏

        /* 名稱:

        說明:本例使用定時器演奏一段音

        階,播放由 K1 控制。

        */

        #includereg51.h>

        #define uchar unsigned char

        #define uint unsigned int

        sbit K1=P1^0;

        sbit SPK=P3^4;

        uint i=0; //音符索引

        //14 個音符放在方式 2 下的定時寄存器

        (TH0,TL0)

        uchar code HI_LIST[]={0,226,229,232,233,236,238,240,241,242,244,245,246,247,248};

        uchar code LO_LIST[]={0,4,13,10,20,3,8,6,2,23,5,26,1,4,3};

        //定時器 0 中斷函數(shù)

        void T0_INT() interrupt 1

        {

        TL0=LO_LIST[i];

        TH0=HI_LIST[i];

        SPK=~SPK;

        }

        //延時

        void DelayMS(uint ms)

        {

        uchar t;

        while(ms--) for(t=0;t120;t++);

        }


        上一頁 1 2 下一頁

        評論


        相關(guān)推薦

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

        關(guān)閉