9 years, 5 months ago.

Blinky doesn't work

Hi,

When I select the RedBearLab BLE Nano as my target platform and import the nRF51822_blinky program, after I compiling and downloading to drag to the mbed disk, the on board LED didn't blink.

include the mbed library with this snippet

#include "mbed.h"
 
DigitalOut myled(LED1);
 
int main() {
    while(1) {
        myled = 1;
        wait(1);
        myled = 0;
        wait(1);
    }
}

Then I changed the LED1 to LED, the compiler just prompt error:

  • Error: Identifier "LED" is undefined in "main.cpp", Line: 3, Col: 18

But if I change the LED1 to P0_19 or p19, the on board LED worked well. I checked the BLE Nano's PinNames.h, it looks that using the LED1 and LED in the program might be OK.

include the mbed library with this snippet

    LED     = p19,
    LED1    = p19,
    LED2    = p19,
    LED3    = p19,
    LED4    = p19,

So, what's the problem? Thanks.

Question relating to:

BLE Nano is the smallest Bluetooth 4.1 Low Energy (BLE) development board in the market. The core is Nordic nRF51822 (an ARM Cortex-M0 SoC plus BLE capability) running at 16MHz …

The problem has been resolved now. Thanks!

posted by RedBearLab Hong Kong 05 Dec 2014

1 Answer

9 years, 5 months ago.

Are you sure you have RedBearLab BLE Nano selected as your target?

Nordic nRF51-Dongle does not have 'LED' in the PinNames.h library and different physical pins for PinNames of the other LEDx options and would give this error if it were selected instead.

I'm sure I have selected RedBearLab BLE Nano as my target. According to what you said, when I use LED1 it will give error, but it didn't and compilation came through.

posted by RedBearLab Hong Kong 18 Nov 2014