diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2013-11-08 21:28:22 +0400 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2013-11-08 21:28:22 +0400 |
commit | 697df775f91ad279cb92d220a4a941f464f0628a (patch) | |
tree | 0efd4895a1e344d1040a802e441c546b51302f38 /src/modules | |
parent | 08b2c338f605d4d9ffa15b151368e127ead241e3 (diff) | |
download | px4-firmware-697df775f91ad279cb92d220a4a941f464f0628a.tar.gz px4-firmware-697df775f91ad279cb92d220a4a941f464f0628a.tar.bz2 px4-firmware-697df775f91ad279cb92d220a4a941f464f0628a.zip |
sensors: fixed bug discharged battery current
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/sensors/sensors.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp index 313923bcb..2cd122ce5 100644 --- a/src/modules/sensors/sensors.cpp +++ b/src/modules/sensors/sensors.cpp @@ -1189,7 +1189,7 @@ Sensors::adc_poll(struct sensor_combined_s &raw) if (_battery_status.timestamp != 0) { _battery_status.current_a = (buf_adc[i].am_data * _parameters.battery_current_scaling); float dt = fminf(20.0f, (hrt_absolute_time() - _last_adc) * 0.001f); // in ms, limit to 20ms - _battery_status.discharged_mah += _battery_status.current_a * dt; + _battery_status.discharged_mah += _battery_status.current_a * dt / 3600.0f; } } else if (ADC_AIRSPEED_VOLTAGE_CHANNEL == buf_adc[i].am_channel) { |