diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-21 20:21:20 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-21 20:21:20 +0200 |
commit | 07d11583bb0926ac9fe1cf2f1c7e11c683606a4b (patch) | |
tree | e673235d4b0c7a91420e609ae1bb18466feb8790 /src/modules | |
parent | 178b0f7399ab881e44f2d2ecff809aea53a4397d (diff) | |
download | px4-firmware-07d11583bb0926ac9fe1cf2f1c7e11c683606a4b.tar.gz px4-firmware-07d11583bb0926ac9fe1cf2f1c7e11c683606a4b.tar.bz2 px4-firmware-07d11583bb0926ac9fe1cf2f1c7e11c683606a4b.zip |
Rely on theoretical value, as the closed-loop test with multimeter suggests this is the most accurate measurement
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/px4iofirmware/registers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/px4iofirmware/registers.c b/src/modules/px4iofirmware/registers.c index 8c15c66c1..43161aa70 100644 --- a/src/modules/px4iofirmware/registers.c +++ b/src/modules/px4iofirmware/registers.c @@ -751,7 +751,7 @@ registers_get(uint8_t page, uint8_t offset, uint16_t **values, unsigned *num_val */ unsigned counts = adc_measure(ADC_VBATT); if (counts != 0xffff) { - unsigned mV = (0 + (counts * 4593)) / 1000; + unsigned mV = (166460 + (counts * 45934)) / 10000; unsigned corrected = (mV * r_page_setup[PX4IO_P_SETUP_VBATT_SCALE]) / 10000; r_page_status[PX4IO_P_STATUS_VBATT] = corrected; |