UoD ME21001 Group 2 02 / Mbed 2 deprecated exercise4

Dependencies:   mbed

main.cpp

Committer:
matt495
Date:
2018-09-25
Revision:
0:9a2d6e5f53d0

File content as of revision 0:9a2d6e5f53d0:

/****************************************************************
/ Simple program to show basic program structure
/
/ The program flashes onboard LED #1, #2 and #3 on/off in sequence for 1 second and continues this indefinitely.
*************************************************************/

#include "mbed.h"

DigitalOut myled(p23);                    // use onboard LED #1 (red)
DigitalOut myled2(p25);                    // use onboard LED #2 (green)
DigitalOut myled3(p24);                    // use onboard LED #3 (yellow)

int main() {
 
    while(1) {                            // repeat indefinitely
        myled = 1;                        // turn on LED #1
        myled2 = 1;                       // turn on LED #2
        myled3 = 1;                       // turn on LED #3
        wait(1);                         // wait 1s
        myled = 0;                       // turn off LED #1
        myled2 = 0;                       // turn off LED #2
        myled3 = 0;                       // turn off LED #3
        wait(1);                       // wait 1s
    }       
}