日本a√视频在线,久久青青亚洲国产,亚洲一区欧美二区,免费g片在线观看网站

        <style id="k3y6c"><u id="k3y6c"></u></style>
        <s id="k3y6c"></s>
        <mark id="k3y6c"></mark>
          
          

          <mark id="k3y6c"></mark>

          新聞中心

          EEPW首頁(yè) > 模擬技術(shù) > 設(shè)計(jì)應(yīng)用 > 基于LPC1114的學(xué)習(xí)型紅外遙控器程序設(shè)計(jì)

          基于LPC1114的學(xué)習(xí)型紅外遙控器程序設(shè)計(jì)

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

          本設(shè)計(jì)就是采用+OLED+接收頭構(gòu)成一個(gè)

            安 裝LPCxpress,后插入LPC-Link 自動(dòng)識(shí)別,

            系統(tǒng)多出一個(gè)

            

          基于LPC1114的學(xué)習(xí)型紅外遙控器程序設(shè)計(jì)

            然后打開(kāi)11XX的例程,正常安裝路徑在C:nxp lpcxpresso_3.1ExamplesLPC1000LPC11xx下

            文件名字 LPCXpresso1114_v1.00.zip

            然后點(diǎn)擊GPIO程序,打開(kāi)GPIOtest.c開(kāi)始學(xué)習(xí)。

            發(fā)現(xiàn)和普通的 8位機(jī)真的相差很多,用了很多類似函數(shù)(庫(kù))的東西。

            別的不管,先來(lái)個(gè)最簡(jiǎn)單的閃爍燈。

            找到函數(shù)

            功能:(設(shè)置 GPIO口方向),參數(shù)(端口號(hào),位,輸入或輸出(0入1出))

            GPIOSetDir( PORT0, 1, 0 );

            和

            GPIOSetValue()

            一 個(gè)是設(shè)置端口方向,一個(gè)是設(shè)置輸出的值,直接調(diào)用就可以了。

            下面是我的程序,本人菜鳥(niǎo)一只,程序也不會(huì)寫,希望大家拍磚的話,別往死里拍, 呵呵。

            用的是P32的口。輸出1的時(shí)候點(diǎn)亮LED。

            /*****************************************************************************

            * gpiotest.c: main C entry file for NXP LPC11xx Family Microprocessors

            *

            * Copyright(C) 2008, NXP Semiconductor

            * All rights reserved.

            *

            * History

            * 2009.12.07 ver 1.00 Preliminary version, first Release

            *

            ******************************************************************************/

            #include "LPC11xx.h" /* LPC11xx Peripheral Registers */

            #include "gpio.h"

            /*****************************************************************************

            ** Main Function main()

            ******************************************************************************/

            int main (void)

            {

            /* Basic chip initialization is taken care of in SystemInit() called

            * from the startup code. SystemInit() and chip settings are defined

            * in the CMSIS system_.c file.

            */

            uint32_t a=60000;

            GPIOInit();

            GPIOSetDir(PORT3,2,1);

            while(1)

            {

            a=160000;

            while(a--);

            GPIOSetValue(PORT3,2,0);

            a=160000;

            while(a--);

            GPIOSetValue(PORT3,2,1);

            }

            /* use port0_1 as input event, interrupt test. */

            GPIOSetDir( PORT0, 1, 0 );

            /* port0_1, single trigger, active high. */

            GPIOSetInterrupt( PORT0, 1, 0, 0, 0 );

            GPIOIntEnable( PORT0, 1 );

            /* use port1_1 as input event, interrupt test. */

            GPIOSetDir( PORT1, 1, 0 );

            /* port0_1, single edge trigger, active high. */

            GPIOSetInterrupt( PORT1, 1, 0, 0, 0 );

            GPIOIntEnable( PORT1, 1 );

            /* use port2_1 as input event, interrupt test. */

            GPIOSetDir( PORT2, 1, 0 );

            /* port0_1, single edge trigger, active high. */

            GPIOSetInterrupt( PORT2, 1, 0, 0, 0 );

            GPIOIntEnable( PORT2, 1 );

            /* use port3_1 as input event, interrupt test. */

            GPIOSetDir( PORT3, 1, 0 );

            /* port0_1, single edge trigger, active high. */

            GPIOSetInterrupt( PORT3, 1, 0, 0, 0 );

            GPIOIntEnable( PORT3, 1 );

            while( 1 );

            }

            /*********************************************************************************

            ** End Of File

            *********************************************************************************/



          評(píng)論


          相關(guān)推薦

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

          關(guān)閉