This program i got from internet this program work superbly
/******************** (C) COPYRIGHT 2010 Embest Info&Tech Co.,LTD. ********************
* File Name : main.c
* Author : Wuhan R&D Center, Embest
* Date First Issued : 10/15/2010
* Description : LED blinky example.
***************************************************************************************
***************************************************************************************
* History:
* 10/15/2010: V1.0
**************************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "lpc12xx_libcfg.h"
void delay(unsigned short int ms) ;
/* Private define ------------------------------------------------------------*/
/* Number of user LEDs */
#define LED_NUM 1
const unsigned long led_mask[] = { 30};
/* Private variables ---------------------------------------------------------*/
/* SysTick Counter */
volatile unsigned long SysTickCnt;
/* Private functions ---------------------------------------------------------*/
void SysTick_Handler (void);
void Delay (unsigned long tick);
/**
* @brief SysTick handler sub-routine (1ms)
* @param None
* @return None
*/
void SysTick_Handler (void) {
SysTickCnt++;
}
/**
* @brief Delay function
* @param tick - number milisecond of delay time
* @return None
*/
void Delay (unsigned long tick) {
unsigned long systickcnt;
systickcnt = SysTickCnt;
while ((SysTickCnt - systickcnt) < tick);
}
/**
* @brief Main program body
* @param None
* @return int
*/
int main (void) { /* Main Program */
int num = -1;
IOCON_PIO_CFG_Type PIO_mode;
//SysTick_Config(SystemCoreClock/1000 - 1); /* Generate interrupt each 1 ms */
SYS_ConfigAHBCLK(SYS_AHBCLKCTRL_GPIO0, ENABLE);
IOCON_StructInit(&PIO_mode);
PIO_mode.type = IOCON_PIO_0_30;
IOCON_SetFunc(&PIO_mode);
GPIO_SetDir(LPC_GPIO0, 30, 1);
GPIO_SetLowLevel(LPC_GPIO0, 30, 1);
for (;;) { /* Loop forever */
GPIO_SetLowLevel(LPC_GPIO0, 30, 1);
delay(500);
GPIO_SetHighLevel(LPC_GPIO0, 30, 1);
delay(500);
}
}
void delay(unsigned short int ms)
{
unsigned short int j;
unsigned long i;
for(j=0;j<ms;j++)
for(i=0;i<1700;i++);
}
#ifdef DEBUG
/**
* @brief Reports the name of the source file and the source line number
* where the CHECK_PARAM error has occurred.
* @param file file Pointer to the source file name
* @paramline line assert_param error line source number
* @return None
*/
void check_failed(uint8_t *file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* Infinite loop */
while(1);
}
#endif
/**
* @}
*/
/* --------------------------------- End Of File ------------------------------ */