single current only

Dependencies:   Watchdog mbed

Files at this revision

API Documentation at this revision

Comitter:
magdamcn
Date:
Mon Feb 20 13:10:52 2017 +0000
Parent:
5:3298063f12fe
Commit message:
wd.Service();

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Feb 06 15:26:22 2017 +0000
+++ b/main.cpp	Mon Feb 20 13:10:52 2017 +0000
@@ -249,7 +249,7 @@
     if (wd.WatchdogCausedReset())
        printf("Watchdog caused reset.\r\n");    
 
-    wd.Configure(5.0);    
+    wd.Configure(5.0);                                          // Watchdog configured for a 5 second timeout.     
     
     float reading_pp;                                           // Create variable to store pp reading.
     bool cable_connected = false;                               // Create boolean to flag whether a cable is attached.
@@ -257,6 +257,8 @@
     
     while(true)                                                 // Start of process loop. 
     {
+        wd.Service();                                           // Service the Watchdog so it does not cause a system reset.
+        
         // check the cable using pp value
         reading_pp = pp_value.read();                           // Read pp value and ...
         reading_pp = reading_pp * 3300;                         // ... multiply it by 3300 to convert to mV.