SmartCharge
/
2017charger_16ampONLY
single current only
Diff: main.cpp
- Revision:
- 6:a995aabdcbcc
- Parent:
- 5:3298063f12fe
--- 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.