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:b3b53918c94d, 2016-12-01 (annotated)
- Committer:
- manisha_g
- Date:
- Thu Dec 01 07:44:15 2016 +0000
- Revision:
- 0:b3b53918c94d
manishapooja2oo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
manisha_g | 0:b3b53918c94d | 1 | #include "mbed.h" |
manisha_g | 0:b3b53918c94d | 2 | |
manisha_g | 0:b3b53918c94d | 3 | DigitalOut pin(LED2); |
manisha_g | 0:b3b53918c94d | 4 | |
manisha_g | 0:b3b53918c94d | 5 | int main() { |
manisha_g | 0:b3b53918c94d | 6 | // do something... |
manisha_g | 0:b3b53918c94d | 7 | |
manisha_g | 0:b3b53918c94d | 8 | // flash 5 times |
manisha_g | 0:b3b53918c94d | 9 | for(int i=0; i<10; i++) { |
manisha_g | 0:b3b53918c94d | 10 | pin = !pin; |
manisha_g | 0:b3b53918c94d | 11 | wait(0.2); |
manisha_g | 0:b3b53918c94d | 12 | } |
manisha_g | 0:b3b53918c94d | 13 | |
manisha_g | 0:b3b53918c94d | 14 | // do something else |
manisha_g | 0:b3b53918c94d | 15 | |
manisha_g | 0:b3b53918c94d | 16 | // flash 2 times |
manisha_g | 0:b3b53918c94d | 17 | for(int i=0; i<4; i++) { |
manisha_g | 0:b3b53918c94d | 18 | pin = !pin; |
manisha_g | 0:b3b53918c94d | 19 | wait(0.2); |
manisha_g | 0:b3b53918c94d | 20 | } |
manisha_g | 0:b3b53918c94d | 21 | |
manisha_g | 0:b3b53918c94d | 22 | // do another thing |
manisha_g | 0:b3b53918c94d | 23 | } |