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.
Fork of DocTest by
main.cpp@1:6fc14cd8ccf1, 2015-03-11 (annotated)
- Committer:
- eencae
- Date:
- Wed Mar 11 16:03:08 2015 +0000
- Revision:
- 1:6fc14cd8ccf1
- Parent:
- 0:b85460bc73b9
- Child:
- 2:5446154a4028
Added some more examples.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| eencae | 0:b85460bc73b9 | 1 | /** |
| eencae | 0:b85460bc73b9 | 2 | @file main.cpp |
| eencae | 0:b85460bc73b9 | 3 | |
| eencae | 0:b85460bc73b9 | 4 | @brief Program implementation |
| eencae | 0:b85460bc73b9 | 5 | |
| eencae | 0:b85460bc73b9 | 6 | */ |
| eencae | 0:b85460bc73b9 | 7 | #include "main.h" |
| eencae | 0:b85460bc73b9 | 8 | |
| eencae | 0:b85460bc73b9 | 9 | int main() { |
| eencae | 1:6fc14cd8ccf1 | 10 | |
| eencae | 1:6fc14cd8ccf1 | 11 | /// flash LED in infinite loop |
| eencae | 0:b85460bc73b9 | 12 | while(1) { |
| eencae | 0:b85460bc73b9 | 13 | myled = 1; |
| eencae | 0:b85460bc73b9 | 14 | wait(0.2); |
| eencae | 0:b85460bc73b9 | 15 | myled = 0; |
| eencae | 0:b85460bc73b9 | 16 | wait(0.2); |
| eencae | 0:b85460bc73b9 | 17 | } |
| eencae | 0:b85460bc73b9 | 18 | } |
| eencae | 0:b85460bc73b9 | 19 | |
| eencae | 0:b85460bc73b9 | 20 | |
| eencae | 1:6fc14cd8ccf1 | 21 | int sum(int a, int b) { |
| eencae | 0:b85460bc73b9 | 22 | |
| eencae | 1:6fc14cd8ccf1 | 23 | /// calculate the sum of the two arguments and return |
| eencae | 1:6fc14cd8ccf1 | 24 | return a + b; |
| eencae | 0:b85460bc73b9 | 25 | } |
