single current only

Dependencies:   Watchdog mbed

Revision:
5:3298063f12fe
Parent:
4:41573ae73f98
Child:
6:a995aabdcbcc
--- a/main.cpp	Mon Feb 06 12:16:17 2017 +0000
+++ b/main.cpp	Mon Feb 06 15:26:22 2017 +0000
@@ -86,6 +86,8 @@
 int TESTCOUNTER = 0;                                            // Variable to count number of cycles of main loop. Used to determine when to switch the pwm in this test version.
 
 int stateB_COUNTER = 0;                                         // Variable to count number of cycles of main loop. Used to reset charger from state B - 9V to state A and re-initiate charging.
+Watchdog wd;
+
 
 // ************************************************************
 // *   New Acquisition Routine for Capturing CP Signal Data   *                                    
@@ -240,9 +242,15 @@
 // ************************************************************
 int main() 
 {        
+    
     button.fall(&reset_pressed);                                // Attach interupt to button when pressed.
     button.rise(&reset_released);                               // Attach interupt to button when released.
     
+    if (wd.WatchdogCausedReset())
+       printf("Watchdog caused reset.\r\n");    
+
+    wd.Configure(5.0);    
+    
     float reading_pp;                                           // Create variable to store pp reading.
     bool cable_connected = false;                               // Create boolean to flag whether a cable is attached.
     bool pwm_state = false;                                     // Create boolean to flag current state of pwm (whether it is on or off).