6 years, 5 months ago.

MBED Blinky Program not Working on LPC1549

So I just got the LPC1549 LPCXpresso board and I find that the first program blinky does not work at all. The wait() function seems to not work at all. I've got my LPCXpresso board programmed correctly (I installed the firmware and a drive called MBED pops up when I connect it to my computer), but the wait function does not work at all. I tried using wait_ms(), wait_us() and none of those work. The only way I was able to get the LED blinking was by replacing the wait() statements with empty for loops like for(int i = 0; i < 1000000; i++) {}.

The current code I have is this,

include the mbed library with this snippet

#include "mbed.h"

DigitalOut green(P1_1);

int main(void)
{
    int delay = 1000000;

    while(true) {
        green = 0;
        for(int i = 0; i < delay; i++ ) {
            }
        green = 1;
        for(int i = 0; i < delay; i++ ) {
            }
    }
}

I would prefer not to have a bunch of empty for loops instead of using the wait function.

Be the first to answer this question.