Browse Source

Исправил делители под новую схему.

Vladimir N. Shilov 8 years ago
parent
commit
4f49358170
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/main.c

+ 4 - 3
src/main.c

@@ -180,10 +180,11 @@ void main(void)
         tbuf >>= 3; // pre div
         tbuf *= 3300; // Vref = Vcc
         tbuf = (tbuf + 4096) / 8191; // get ADC input voltage in mV
-        tbuf *= 1000; // get voltage in uV
-        tbuf = (tbuf + 14) / 28; // get voltage from shunt
+        tbuf *= 1000; // -- for OU divider //get voltage in uV
+        tbuf = (tbuf + 3147) / 6294; // get voltage from shunt
         /* â Current òîê â ìèëèàìïåðàõ */
-        Current = (tbuf + 3) / 6; // shunt resistance in mOhms
+        tbuf *= 1000; // get voltage in uV
+        Current = (tbuf + 25) / 50; // shunt resistance in mOhms
 
         SubSecondBfr += Current;
         SubSecondCnt --;