Completed Snake Program

Dependencies:   N5110 PinDetect PowerControl mbed

Fork of DocTest by Craig Evans

Files at this revision

API Documentation at this revision

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