Content originally posted in LPCWare by Irappa on Sat Sep 14 03:54:21 MST 2013
Just create a project, don't add any header files or source files in source foder.
Try this code:
/*
===============================================================================
Name : main.c
Author :
Version :
Copyright : Copyright (C)
Description : main definition
===============================================================================
*/
#ifdef __USE_CMSIS
#include "LPC17xx.h"
#endif
void delay(int);
// TODO: insert other include files here
// TODO: insert other definitions and declarations here
int main(void) {
LPC_GPIO0->FIODIR = 0x000000FF;
LPC_GPIO0->FIOCLR = 0x000000FF;
// TODO: insert code here
// Enter an infinite loop, just incrementing a counter
//volatile static int i = 0 ;
while(1) {
LPC_GPIO0->FIOSET = 1<<6;
delay(5000);
LPC_GPIO0->FIOCLR = 0x000000FF;
delay(5000);
//i++ ;
}
return 0 ;
}
void delay(int x)
{
unsigned int k,l;
for(k = x;k > 0;k--)
for(l = 0;l < x;l++);
}