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