Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Homepage
This program detects the LPCXpresso and mbed at run time.
There is a difference in the value of the CoreDebugRegister LPCXpresso and mbed.
The program check those bits and select platform type.
#include "mbed.h" #include "PlatformInfo.h" DigitalOut mbedled(LED1); DigitalOut lpcxled(P0_22); using namespace MiMic; int main(){ switch(PlatformInfo::getPlatformType()){ case PlatformInfo::PF_MBED: while(1) { mbedled = 1; wait(0.2); mbedled = 0; wait(0.2); } case PlatformInfo::PF_LPCXPRESSO: while(1) { lpcxled = 1; wait(0.1); lpcxled = 0; wait(0.1); } } }
If program run on mbed, LED1(blue) will be blinking. If it run on LPCXpresso, LED2(red) will be blinking.