Ashwini Chitragar
/
HelloWorld
port
Fork of HelloWorld by
Revision 2:7c55264e0187, committed 2016-12-01
- Comitter:
- ashchitragar
- Date:
- Thu Dec 01 08:29:50 2016 +0000
- Parent:
- 1:03c191369089
- Commit message:
- pin
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
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