From 8eedb2c040254cc85882c6042fba2cfdf2fa5b6a Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Wed, 11 Feb 2015 20:50:55 +0900 Subject: [PATCH] Copter: sent battery voltage and current to motors --- ArduCopter/sensors.pde | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ArduCopter/sensors.pde b/ArduCopter/sensors.pde index 5c22d64711..13d77af0da 100644 --- a/ArduCopter/sensors.pde +++ b/ArduCopter/sensors.pde @@ -150,6 +150,14 @@ static void read_battery(void) compass.set_current(battery.current_amps()); } + // update motors with voltage and current + if (battery.get_type() != AP_BattMonitor::BattMonitor_TYPE_NONE) { + motors.set_voltage(battery.voltage()); + } + if (battery.has_current()) { + motors.set_current(battery.current_amps()); + } + // check for low voltage or current if the low voltage check hasn't already been triggered // we only check when we're not powered by USB to avoid false alarms during bench tests if (!ap.usb_connected && !failsafe.battery && battery.exhausted(g.fs_batt_voltage, g.fs_batt_mah)) {