SEARCH
TOOLBOX
LANGUAGES
modified on 14 August 2014 at 14:34 ••• 46,662 views

02-01 SimpleLED

From Manuals

Revision as of 14:34, 14 August 2014 by Support (Talk | contribs)
Jump to: navigation, search

A very simple example that blinks LED1. LED1 blinks around 2 times a second. LED1 is located in the bottom left hand side of the board.

/* Program Example 2.1: Simple LED flashing
                                                      */
#include "mbed.h"
DigitalOut myled(LED1);

int main()
{
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}