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.
Dependencies: N5110 PinDetect PowerControl mbed
Fork of DocTest by
Revision 1:6fc14cd8ccf1, committed 2015-03-11
- Comitter:
- eencae
- Date:
- Wed Mar 11 16:03:08 2015 +0000
- Parent:
- 0:b85460bc73b9
- Child:
- 2:deb61a34ac31
- Commit message:
- Added some more examples.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| main.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Mar 11 10:55:42 2015 +0000
+++ b/main.cpp Wed Mar 11 16:03:08 2015 +0000
@@ -7,6 +7,8 @@
#include "main.h"
int main() {
+
+ /// flash LED in infinite loop
while(1) {
myled = 1;
wait(0.2);
@@ -16,12 +18,8 @@
}
-/**
-* Doesn't really. Just an example function.
-* @param a - some random value
-* @returns the same value
-*/
-int blink(int a) {
+int sum(int a, int b) {
- return a;
+ /// calculate the sum of the two arguments and return
+ return a + b;
}
\ No newline at end of file
--- a/main.h Wed Mar 11 10:55:42 2015 +0000 +++ b/main.h Wed Mar 11 16:03:08 2015 +0000 @@ -1,13 +1,10 @@ /** @file main.h - -@brief Header file containing functions prototypes, defines and global variables -@brief Shows examples of creating Doxygen documentation -@brief Revision 1.0 - +@brief Header file containing functions prototypes, defines and global variables. +@brief Shows examples of creating Doxygen documentation. +@brief Revision 1.0. @author Craig A. Evans @date March 2015 - */ #ifndef MAIN_H @@ -17,12 +14,20 @@ #include "mbed.h" - +/** +@namespace myled +@brief GPIO output for status LED +*/ DigitalOut myled(LED1); -int globalInt; /*!< an integer value */ +int printFlag; /*!< print flag set in ISR */ - -int blink(int a); +/** +Adds up two integer variables +@param a - integer to add +@param b - integer to add +@returns the sum of a and b +*/ +int sum(int a, int b); #endif
