Treehouse Mbed Team / Mbed 2 deprecated APS_DCM1SL2

Dependencies:   mbed

Revision:
18:78e982f31c6b
Parent:
17:454afe56eedb
Child:
19:1f6363b6a9da
diff -r 454afe56eedb -r 78e982f31c6b src/main.cpp
--- a/src/main.cpp	Thu Dec 13 21:58:28 2018 +0000
+++ b/src/main.cpp	Fri Dec 14 00:31:15 2018 +0000
@@ -95,7 +95,7 @@
       if(running){
           //The current sensors results are single-ended. Results below the midpoint are for buck mode, above is for boost mode.
           if(adcVals.i12 < CURRENT_12_OFFSET){  
-            updateControls(adcVals.i12);
+            updateControls(CURRENT_12_OFFSET-adcVals.i12);
             buck = TRUE;
           }else{
             updateControls(adcVals.i12-CURRENT_12_OFFSET);