led_test.c

来自「IARSOURCECODE是基于LPC2478嵌入式软件IAR EWARM V4」· C语言 代码 · 共 39 行

C
39
字号
#include "LPC2468.h"                        /* LPC24xx definitions */
#include "type.h"
#include "target.h"

#include "fio.h"

/*****************************************************************************
**   Main Function  main()
******************************************************************************/
int main (void)
{
    DWORD counter=0,i;

//    TargetResetInit();

    /* GPIOInit() need to be carefully called if you want to run some
	other peripherals, it will set the PINSEL to default value and change
	the direction of IOs. */

    GPIOInit( 3, FAST_PORT, DIR_OUT );    // 将P3组配置为输出口

    LedsInit();


    while ( 1 )
	{
          for(i=0;i<999999;i++)i=i;
	  LedOn(counter);
          for(i=0;i<999999;i++)i=i;
	  LedOff(counter);
          counter++;
	}

}

/*****************************************************************************
**                            End Of File
*****************************************************************************/

⌨️ 快捷键说明

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