smart sensor code initial version
Dependencies: mbed-src-KL05Z-smart-sensor
Diff: kl05-smart-sensor.cpp
- Revision:
- 2:5dacfd690a75
- Parent:
- 1:587e0346abca
- Child:
- 3:d908dc9882d2
--- a/kl05-smart-sensor.cpp Tue Mar 26 10:41:49 2019 +0000 +++ b/kl05-smart-sensor.cpp Tue Mar 26 10:48:58 2019 +0000 @@ -52,10 +52,10 @@ #define BUFFMEASURES 0 // If TRACEPRINT == 1 : trace the time comnsumes by the printf to the uart console -#define TRACEPRINT 1 +#define TRACEPRINT 0 // If DEBUG == 1 : do not buffer the measures but send the measures thru the uart console (measures duration (volt + current), sensor number, timestamps, voltage, current, high current, mid current, low current -#define DEBUG 1 +#define DEBUG 0 // set things up... #if (USEI2CNOTUART == 1) @@ -283,7 +283,7 @@ float measureAutoI(int nbMeas){ float tempI; - enableHighRange(); // this should already be the case, but do it anyway... +//VB enableHighRange(); // this should already be the case, but do it anyway... #if (USEI2CNOTUART == 0) current[0] = 0; current[1] = 0; @@ -296,7 +296,7 @@ status = 1; // if current is below this threshold, use LOW1 to measure... if (tempI < 0.060) { - enableLow1Range(); +//VB enableLow1Range(); tempI = measureLow1(false, nbMeas); // call function #if (USEI2CNOTUART == 0) current[1] = tempI; @@ -304,14 +304,14 @@ status = 2; // if current is below this threshold, use LOW2 to measure... if (tempI < 0.0009){ - enableLow2Range(); // change FETs to enable LOW2 measurement... +//VB enableLow2Range(); // change FETs to enable LOW2 measurement... tempI = measureLow2(false, nbMeas); #if (USEI2CNOTUART == 0) current[2] = tempI; #endif status = 3; } - enableHighRange(); +//VB enableHighRange(); } return tempI; }