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

<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è)計(jì)應(yīng)用 > 單片機(jī)C語言程序設(shè)計(jì):串行數(shù)據(jù)轉(zhuǎn)換為并行數(shù)據(jù)

        單片機(jī)C語言程序設(shè)計(jì):串行數(shù)據(jù)轉(zhuǎn)換為并行數(shù)據(jù)

        作者: 時(shí)間:2013-09-05 來源:網(wǎng)絡(luò) 收藏

        /* 名稱:轉(zhuǎn)換為


        說明:由 RXD 發(fā)送給串


        并轉(zhuǎn)換芯片 74164,TXD 則用于輸出移位時(shí)鐘脈沖,74164 將串行輸入的 1 字節(jié)轉(zhuǎn)換為,并將轉(zhuǎn)換的數(shù)據(jù)通過 8 只 LED 顯示出來。本例串口工作模式 0,即移位寄存器 I/O 模式。


        */


        #includereg51.h>

        #includeintrins.h>


        #define uchar unsigned char


        #define uint unsigned int


        sbit SPK=P3^7;


        uchar FRQ=0x00;


        //延時(shí)


        void DelayMS(uint ms)


        {


        uchar i;


        while(ms--) for(i=0;i120;i++);


        }


        //主程序


        void main()


        {


        uchar c=0x80;


        SCON=0x00; //串口模式 0,即移位寄存器輸入/輸出方式


        TI=1;


        while(1)


        {


        c=_crol_(c,1);


        SBUF=c;


        while(TI==0); //等待發(fā)送結(jié)束

        TI=0; //TI 軟件置位

        DelayMS(400);

        }


        }

        /* 名稱:轉(zhuǎn)換為


        說明:串行數(shù)據(jù)由 RXD 發(fā)送給串


        并轉(zhuǎn)換芯片 74164,TXD 則用于輸出移位時(shí)鐘脈沖,74164 將串行輸入的 1 字節(jié)轉(zhuǎn)換為并行數(shù)據(jù),并將轉(zhuǎn)換的數(shù)據(jù)通過 8 只 LED 顯示出來。本例串口工作模式 0,即移位寄存器 I/O 模式。


        */


        #includereg51.h>

        #includeintrins.h>


        #define uchar unsigned char


        #define uint unsigned int


        sbit SPK=P3^7;


        uchar FRQ=0x00;

        c語言相關(guān)文章:c語言教程



        上一頁 1 2 下一頁

        評(píng)論


        相關(guān)推薦

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

        關(guān)閉