From 240b0b43fd0d65506c918f776c8111d0af31c608 Mon Sep 17 00:00:00 2001 From: rmackay9 Date: Sat, 13 Oct 2012 20:52:14 +0900 Subject: [PATCH] ArduCopter: small comment fixes related to battery monitoring --- ArduCopter/Parameters.pde | 12 ++++++------ ArduCopter/sensors.pde | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ArduCopter/Parameters.pde b/ArduCopter/Parameters.pde index 143d187315..c6f192ab6d 100644 --- a/ArduCopter/Parameters.pde +++ b/ArduCopter/Parameters.pde @@ -116,16 +116,16 @@ const AP_Param::Info var_info[] PROGMEM = { GSCALAR(tilt_comp, "TILT", TILT_COMPENSATION), // @Param: BATT_VOLT_PIN - // @DisplayName: Battery Voltage sending pin - // @Description: Setting this to 0 ~ 11 will enable battery voltage sending on pins A0 ~ A11. Current will be measured on this pin + 1 - // @Values: 99:Disabled, 0:A0, 1:A1, 10:A13 + // @DisplayName: Battery Voltage sensing pin + // @Description: Setting this to 0 ~ 13 will enable battery current sensing on pins A0 ~ A13. + // @Values: 99:Disabled, 0:A0, 1:A1, 13:A13 // @User: Standard GSCALAR(battery_volt_pin, "BATT_VOLT_PIN", BATTERY_VOLT_PIN), // @Param: BATT_CURR_PIN - // @DisplayName: Battery Voltage sending pin - // @Description: Setting this to 0 ~ 11 will enable battery voltage sending on pins A0 ~ A11. Current will be measured on this pin + 1 - // @Values: 99:Disabled, 0:A0, 1:A1, 10:A12 + // @DisplayName: Battery Current sensing pin + // @Description: Setting this to 0 ~ 13 will enable battery current sensing on pins A0 ~ A13. + // @Values: 99:Disabled, 1:A1, 2:A2, 12:A12 // @User: Standard GSCALAR(battery_curr_pin, "BATT_CURR_PIN", BATTERY_CURR_PIN), diff --git a/ArduCopter/sensors.pde b/ArduCopter/sensors.pde index 1623db0f61..6f23c8fcdb 100644 --- a/ArduCopter/sensors.pde +++ b/ArduCopter/sensors.pde @@ -81,7 +81,7 @@ static void read_battery(void) battery_voltage1 = BATTERY_VOLTAGE(batt_volt_pin.read_average()); } if(g.battery_monitoring == 4) { - static AP_AnalogSource_Arduino batt_curr_pin(g.battery_curr_pin); // current is always read from one pin higher than battery voltage + static AP_AnalogSource_Arduino batt_curr_pin(g.battery_curr_pin); current_amps1 = CURRENT_AMPS(batt_curr_pin.read_average()); current_total1 += current_amps1 * 0.02778; // called at 100ms on average, .0002778 is 1/3600 (conversion to hours) }