mirror of
https://github.com/meshtastic/meshtastic.git
synced 2025-02-21 03:25:51 -08:00
for crying out loud...
This commit is contained in:
parent
2964e30485
commit
64e173b8e4
|
@ -1,17 +1,17 @@
|
||||||
export default function calculateADC() {
|
export default function calculateADC() {
|
||||||
//const variables
|
//const variables
|
||||||
let BAT_MILLIVOLTS_FULL = 4.2;
|
const BAT_MILLIVOLTS_FULL = 4.2;
|
||||||
let BAT_MILLIVOLTS_EMPTY = 3.27;
|
const BAT_MILLIVOLTS_EMPTY = 3.27;
|
||||||
let BAT_FULL_PERCENT = 1;
|
const BAT_FULL_PERCENT = 1;
|
||||||
//variable
|
//variable
|
||||||
let batteryChargePercent =
|
const batteryChargePercent =
|
||||||
parseFloat(
|
parseFloat(
|
||||||
(<HTMLInputElement>document.getElementById("batteryChargePercent")).value
|
(<HTMLInputElement>document.getElementById("batteryChargePercent")).value
|
||||||
) / 100;
|
) / 100;
|
||||||
let operativeAdcMultiplier = parseFloat(
|
const operativeAdcMultiplier = parseFloat(
|
||||||
(<HTMLInputElement>document.getElementById("operativeAdcMultiplier")).value
|
(<HTMLInputElement>document.getElementById("operativeAdcMultiplier")).value
|
||||||
);
|
);
|
||||||
let result =
|
const result =
|
||||||
(operativeAdcMultiplier *
|
(operativeAdcMultiplier *
|
||||||
((BAT_FULL_PERCENT - 1) * BAT_MILLIVOLTS_EMPTY -
|
((BAT_FULL_PERCENT - 1) * BAT_MILLIVOLTS_EMPTY -
|
||||||
BAT_FULL_PERCENT * BAT_MILLIVOLTS_FULL)) /
|
BAT_FULL_PERCENT * BAT_MILLIVOLTS_FULL)) /
|
||||||
|
|
Loading…
Reference in a new issue