Ashwini Chitragar
/
HelloWorld
port
Fork of HelloWorld by
Diff: main.cpp
- Revision:
- 2:7c55264e0187
- Parent:
- 0:fb6bbc10ffa0
diff -r 03c191369089 -r 7c55264e0187 main.cpp --- a/main.cpp Sun Jan 01 20:57:57 2012 +0000 +++ b/main.cpp Thu Dec 01 08:29:50 2016 +0000 @@ -1,12 +1,23 @@ #include "mbed.h" - -DigitalOut myled(LED1); - + +DigitalOut pin(LED2); + int main() { - while(1) { - myled = 1; - wait(0.2); - myled = 0; + // do something... + + // flash 5 times + for(int i=0; i<10; i++) { + pin = !pin; wait(0.2); } -} + + // do something else + + // flash 2 times + for(int i=0; i<4; i++) { + pin = !pin; + wait(0.2); + } + + // do another thing +} \ No newline at end of file