DipCortex - Toggle an LED

include the mbed library with this snippet

#include "mbed.h"

// WiFi DipCortex has 1 LED shared with the button on P0_1
DigitalOut Led(P0_1);

// DipCortex has 2 LEDs P0_1 and P1_22
DigitalOut Led2(P1_22);

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


Please log in to post comments.