Monday, 20 July 2015

Blinking EzSBC2 LED's in mbed online compiler

User Jim Kizos has written the basic blinky for EzSBC2 in the mbed environment.

main.cpp is like thus:

#include "mbed.h"

// EzSBC2 has 2 LEDs P1_15 and P1_16

DigitalOut Led1(P1_15);

DigitalOut Led2(P1_16);

int main()
{
    while(1)
    {
        Led2 = !Led2;
        wait_ms(250);
        Led1 = !Led1;
        wait_ms(250);
    }
    }


 Tricky bit 1:

There is no target "EzSBC2" in the mbed online compiler. We need to target DipCortex-M3. You can use all the mbed examples for DipCortex M3, provided you change the pinout to suit the EzSBC2 !

 Tricky bit 2:

Remove the precompiled mbed library. Import the mbed-src full source library into your program. This is because there is a bug in the export to offline IDE / EmBlocks script - the library is not included in the package if you export the official pre-built mbed library - i.e. you won't be able to build in EmBlocks with the package you'll get !! When you export the program with the mbed-src, you'll get everything and will be able to build in EmBlocks (the next blog entry will be about this).


No comments:

Post a Comment