Content originally posted in LPCWare by kabirbansod on Tue Jun 16 13:19:57 MST 2015
I am trying to blink leds, here is how i set up the functions:
#include "LPC13Uxx.h"
#include "gpio.h"
void leds_arch_init(void) {
GPIOSetDir( PORT1,14, 1 );
GPIOSetDir( PORT1,13, 1 );
}
void leds_arch_set(unsigned char leds) {
if(leds & LEDS_GREEN) {
GPIOSetBitValue( 1,13, 1 );
} else {
GPIOSetBitValue( 1,13, 0 );
}
if(leds & LEDS_YELLOW) {
GPIOSetBitValue( 1,14, 1 );
} else {
GPIOSetBitValue( 1,14, 0 );
}
When i try to turn of the LEDs, it doesnt work! What am i doing wrong? While debugging the GPIOSetBitValue() does get called but nothing happens it just goes past " LPC_GPIO->CLR[portNum] = ..." without turning the LED off.