3

Dependencies:   mbed

main.cpp

Committer:
davey
Date:
2017-09-23
Revision:
0:69d25838a298

File content as of revision 0:69d25838a298:

#include "mbed.h"

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

int main() {

 
 while (1) {        // repeat indefinitely
     int x = 0;     // declares 'x' integer
        while (x < 25) {     //Starts loop to go 25 times
            myled = 1;     // turn on LED #1
            wait(0.5);   // wait 0.5s
            myled = 0;     // turn off LED #1
            wait(0.5);   // wait 0.5s 
            x = x + 1; //adds 1 increment to x each time round the loop
       }
       wait(5);     //waits 5 seconds before repeating
    }
}