smart sensor code initial version
Dependencies: mbed-src-KL05Z-smart-sensor
Diff: kl05-smart-sensor.cpp
- Revision:
- 3:d908dc9882d2
- Parent:
- 2:5dacfd690a75
- Child:
- 4:a2f83fac24bc
diff -r 5dacfd690a75 -r d908dc9882d2 kl05-smart-sensor.cpp --- a/kl05-smart-sensor.cpp Tue Mar 26 10:48:58 2019 +0000 +++ b/kl05-smart-sensor.cpp Tue Mar 26 10:50:33 2019 +0000 @@ -252,7 +252,7 @@ for (i = 0; i < nbMeas; i++){ low1I += LOW1_ADC; } - if (!autorange) enableHighRange(); +//VBrun6 if (!autorange) enableHighRange(); low1I = factor_L1 * low1I/nbMeas; #if (USEI2CNOTUART == 0) timestamp = timer.read(); @@ -267,7 +267,7 @@ for (i = 0; i < nbMeas; i++){ low2I += LOW2_ADC; } - if (!autorange) enableHighRange(); +//VBrun6 if (!autorange) enableHighRange(); low2I = factor_L2 * low2I/nbMeas; #if (USEI2CNOTUART == 0) timestamp = timer.read(); @@ -283,7 +283,7 @@ float measureAutoI(int nbMeas){ float tempI; -//VB enableHighRange(); // this should already be the case, but do it anyway... +//VBrun5+run6 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) { -//VB enableLow1Range(); +//VBrun5+run6 enableLow1Range(); tempI = measureLow1(false, nbMeas); // call function #if (USEI2CNOTUART == 0) current[1] = tempI; @@ -304,14 +304,15 @@ status = 2; // if current is below this threshold, use LOW2 to measure... if (tempI < 0.0009){ -//VB enableLow2Range(); // change FETs to enable LOW2 measurement... +//VBrun5+run6 enableLow2Range(); // change FETs to enable LOW2 measurement... tempI = measureLow2(false, nbMeas); #if (USEI2CNOTUART == 0) current[2] = tempI; #endif status = 3; } -//VB enableHighRange(); +//VBrun5 enableHighRange(); + enableHighRange(); } return tempI; }