Rely on theoretical value, as the closed-loop test with multimeter suggests this is the most accurate measurement

This commit is contained in:
Lorenz Meier 2014-07-21 20:21:20 +02:00
parent 178b0f7399
commit 07d11583bb
1 changed files with 1 additions and 1 deletions

View File

@ -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;