blink a led
Dependencies: mbed
Diff: main.cpp
- Revision:
- 12:8dab8b91a92c
- Parent:
- 4:81cea7a352b0
- Child:
- 13:769319201354
diff -r 4cfe2fa00668 -r 8dab8b91a92c main.cpp --- a/main.cpp Tue Mar 08 12:40:16 2016 +0000 +++ b/main.cpp Sat May 28 04:11:22 2016 +0000 @@ -1,12 +1,22 @@ -#include "mbed.h" +#include "mbed.h" // this tells us to load mbed related functions -DigitalOut myled(LED1); - +DigitalOut myled(LED1); // we create a variable 'red', 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); - myled = 0; + + // YOUR CODE HERE : turn off the LED + + + // wait again wait(0.2); } }