A simple program to Toggle the 2 OnBoard LEDs.

main.cpp

Committer:
RGurav
Date:
2018-05-15
Revision:
0:889636b54b07

File content as of revision 0:889636b54b07:

#include "mbed.h"

DigitalOut led2(LED2);
DigitalOut led1(LED1);

// main() runs in its own thread in the OS
int main() 
{
    led1 = 1;
    led2 = 0;
    
    while (true) 
    {
        led2 = !led2;
        led1 = !led1;
        wait(0.5);
    }
}