⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 包含了NXP众多的MCU的例子程序
💻 C
字号:
//This is a LPC2124 or LPC2129 timer interupt demonstration code -LED toggling is done inside hardware.c
/*-------------------------------------------------------------------------------------------------------------------------------*/

#include <iolpc2129.h> //Needed by Macros only usually
#include "hardware.h"  //Supplies Hardware specific macros (e.g. S_BUT1)

/*-------------------------------------------------------------------------------------------------------------------------------*/
void main(void)
{
  CPUinit();
  __disable_interrupt();
  INTERRUPTSinit();
  __enable_interrupt();
  TIMER0initstart();

  A_LED1_OFF;
  A_LED2_OFF;
  while(1)
  {
    //Force LEDs on by pushing Buttons 1,2
    if (S_BUT1==DOWN) A_LED1_ON;
    if (S_BUT2==DOWN) A_LED2_ON;
  }
}
/*-------------------------------------------------------------------------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -