UoD ME21001 Group 2 02 / Mbed 2 deprecated exercise2

Dependencies:   mbed

main.cpp

Committer:
matt495
Date:
2018-09-25
Revision:
0:c1a2bfdd2087

File content as of revision 0:c1a2bfdd2087:

/****************************************************************
/ Simple program to show basic program structure
/
/ The program flashes onboard LED #1 on/off 5 times, one second on and one second off. It then waits 5s before starting again.
/***************************************************************/

#include "mbed.h"

DigitalOut myled(LED1);                    // use onboard LED #1

int main() {
 
    while(1) {                            // repeat indefinitely
        for(int i=0; i<5; i++)  {        // set number of loops to 5
        myled = 1;                        // turn on LED #1
        wait(1.0);                       // wait 1s
        myled = 0;                       // turn off LED #1
        wait(1.0);                       // wait 1s
    }        
    wait (5.0);                           // wait 5s
    }
}