Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
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:
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.
The problem has been resolved now. Thanks!
posted by RedBearLab Hong Kong 05 Dec 2014