Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:89b9f1fd0f22, 2016-11-30 (annotated)
- Committer:
- apoorvagl
- Date:
- Wed Nov 30 08:23:36 2016 +0000
- Revision:
- 0:89b9f1fd0f22
bvbcet
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
apoorvagl | 0:89b9f1fd0f22 | 1 | #include "mbed.h" |
apoorvagl | 0:89b9f1fd0f22 | 2 | |
apoorvagl | 0:89b9f1fd0f22 | 3 | DigitalOut pin(LED2); |
apoorvagl | 0:89b9f1fd0f22 | 4 | |
apoorvagl | 0:89b9f1fd0f22 | 5 | int main() { |
apoorvagl | 0:89b9f1fd0f22 | 6 | // do something... |
apoorvagl | 0:89b9f1fd0f22 | 7 | |
apoorvagl | 0:89b9f1fd0f22 | 8 | // flash 5 times |
apoorvagl | 0:89b9f1fd0f22 | 9 | for(int i=0; i<10; i++) { |
apoorvagl | 0:89b9f1fd0f22 | 10 | pin = !pin; |
apoorvagl | 0:89b9f1fd0f22 | 11 | wait(0.2); |
apoorvagl | 0:89b9f1fd0f22 | 12 | } |
apoorvagl | 0:89b9f1fd0f22 | 13 | |
apoorvagl | 0:89b9f1fd0f22 | 14 | // do something else |
apoorvagl | 0:89b9f1fd0f22 | 15 | |
apoorvagl | 0:89b9f1fd0f22 | 16 | // flash 2 times |
apoorvagl | 0:89b9f1fd0f22 | 17 | for(int i=0; i<4; i++) { |
apoorvagl | 0:89b9f1fd0f22 | 18 | pin = !pin; |
apoorvagl | 0:89b9f1fd0f22 | 19 | wait(0.2); |
apoorvagl | 0:89b9f1fd0f22 | 20 | } |
apoorvagl | 0:89b9f1fd0f22 | 21 | |
apoorvagl | 0:89b9f1fd0f22 | 22 | // do another thing |
apoorvagl | 0:89b9f1fd0f22 | 23 | } |