📄 ledcon.c
字号:
/**********************************************************************
** Program Name : LED BLINK **
** Compiler : Keil **
** Board : MiniARM **
** Firm : UC Micro Systems **
** Website : www.ucmicrosys.com **
** **
** Description : This program blinks LED4 connected to P0.25 **
** Connect LED power jumper before running this **
** program. **
** **
*********************************************************************/
#include "lpc21xx.h"
#define LEDCON 0x02000000 /* P0.25 */
/****************************************************************************
* DelayNS()
****************************************************************************/
void DelayNS(unsigned int dly)
{ unsigned int i;
for(; dly>0; dly--)
for(i=0; i<50000; i++);
}
/****************************************************************************
*main()
****************************************************************************/
int main(void)
{ PINSEL0 = 0x00000000; // Enable GPIO
PINSEL1 = 0x00000000;
IO0DIR = LEDCON; // Enable LED4 Direction
while(1)
{ IO0SET = LEDCON;
DelayNS(30);
IO0CLR = LEDCON;
DelayNS(30);
}
return(0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -