blink a led

Dependencies:   mbed

main.cpp

Committer:
Maggie17
Date:
2016-05-28
Revision:
16:21a80819dad9
Parent:
15:54d9ef9b943e

File content as of revision 16:21a80819dad9:

#include "mbed.h"         // this tells us to load mbed related functions

DigitalOut myled(LED1);   // we create a variable 'myled', use it as an out port
 
// this code runs when the microcontroller starts up
int main() {
    
    // spin in a main loop all the time
    while(1) {
        // turn on LED
        myled = 1;
        
        // wait
        wait(0.2);
        
        // YOUR CODE HERE : turn off the LED
        
        
        // wait again
        wait(0.2);
    }
}