• <li id="00i08"><input id="00i08"></input></li>
  • <sup id="00i08"><tbody id="00i08"></tbody></sup>
    <abbr id="00i08"></abbr>
  • 新聞中心

    EEPW首頁 > 模擬技術 > 設計應用 > 基于LPC1114的學習型紅外遙控器程序設計

    基于LPC1114的學習型紅外遙控器程序設計

    作者: 時間:2012-04-25 來源:網絡 收藏

    本設計就是采用+OLED+接收頭構成一個

      安 裝LPCxpress,后插入LPC-Link 自動識別,

      系統多出一個

      

    基于LPC1114的學習型紅外遙控器程序設計

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

      文件名字 LPCXpresso1114_v1.00.zip

      然后點擊GPIO程序,打開GPIOtest.c開始學習。

      發現和普通的 8位機真的相差很多,用了很多類似函數(庫)的東西。

      別的不管,先來個最簡單的閃爍燈。

      找到函數

      功能:(設置 GPIO口方向),參數(端口號,位,輸入或輸出(0入1出))

      GPIOSetDir( PORT0, 1, 0 );

      和

      GPIOSetValue()

      一 個是設置端口方向,一個是設置輸出的值,直接調用就可以了。

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

      用的是P32的口。輸出1的時候點亮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

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



    評論


    相關推薦

    技術專區

    關閉
    主站蜘蛛池模板: 赤水市| 天祝| 莒南县| 隆回县| 峡江县| 大宁县| 永州市| 凭祥市| 宣威市| 平利县| 电白县| 德阳市| 本溪| 衡南县| 宁陵县| 明水县| 湘乡市| 南澳县| 伊金霍洛旗| 大冶市| 边坝县| 板桥市| 太谷县| 利津县| 金门县| 阳江市| 辽源市| 霸州市| 辽宁省| 清原| 得荣县| 汽车| 贵德县| 施甸县| 通城县| 肥东县| 郴州市| 宁津县| 友谊县| 维西| 招远市|