Basic timer on mBed 1768

Dependencies:   TextLCD mbed

Fork of HelloWorld by Simon Ford

Revision:
3:d18d3609c800
Parent:
2:253054128736
--- a/main.cpp	Sun Sep 28 03:02:57 2014 +0000
+++ b/main.cpp	Sun Sep 28 03:53:02 2014 +0000
@@ -11,7 +11,6 @@
 3. Keyboard Input           : http://mbed.org/handbook/SerialPC
 4. Interrupt attach         : http://mbed.org/handbook/Serial
 5. Enum tutorial            : http://stackoverflow.com/questions/1102542/how-to-define-an-enumerated-type-enum-in-c
-6. 
 
 */
 
@@ -53,6 +52,12 @@
                 timerDisplay.start();
                 timerState = Running;
             }
+            else if(timerState == Paused)
+            {
+                timerReference.start();
+                timerDisplay.start();
+                timerState = Running;
+            }
         }
         if((keyboardInput == 'p' || keyboardInput == 'P')) 
         {
@@ -62,12 +67,7 @@
                 timerDisplay.stop();
                 timerState = Paused;
             }
-            else if(timerState == Paused)
-            {
-                timerReference.start();
-                timerDisplay.start();
-                timerState = Running;
-            }
+            
         } 
         if((keyboardInput == 'r' || keyboardInput == 'R')) 
         {  
@@ -84,8 +84,8 @@
                 calculatedTimeInterval = referenceTimeInterval = runningError = 0;
                 lcd.locate(0,0);
                 lcd.printf("00:00:00");
-                lcd.locate(0,1);
-                lcd.printf("000000");
+                //lcd.locate(0,1);
+                //lcd.printf("000000");
             }
         } 
     }
@@ -138,8 +138,8 @@
             lcd.locate(0,0);
             lcd.printf("%02d:%02d:%02d",minutes, seconds, centiSeconds);
             
-            lcd.locate(0,1);
-            lcd.printf("%06d", runningError);
+            //lcd.locate(0,1);
+            //lcd.printf("%06d", runningError);
             }