This program can detect the type(mbed or LPCXpresso) of platform. The sample recognizes mbed or LPCXpresso.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "PlatformInfo.h"
00003 DigitalOut mbedled(LED1);
00004 DigitalOut lpcxled(P0_22);
00005 using namespace MiMic;
00006 int main(){
00007     
00008 
00009     
00010     switch(PlatformInfo::getPlatformType()){
00011     case PlatformInfo::PF_MBED:
00012         while(1) {
00013             mbedled = 1;
00014             wait(0.2);
00015             mbedled = 0;
00016             wait(0.2);
00017         }
00018     case PlatformInfo::PF_LPCXPRESSO:
00019         while(1) {
00020             lpcxled = 1;
00021             wait(0.1);
00022             lpcxled = 0;
00023             wait(0.1);
00024         }
00025     }    
00026 }