Skip to content

Commit

Permalink
Merge pull request iNavFlight#3 from nkruzan/pr/battery-voltage-changes
Browse files Browse the repository at this point in the history
separate vcc, battery voltages & fix displayed batt voltage
  • Loading branch information
davidbuzz authored Aug 29, 2021
2 parents 1845f22 + d42f580 commit 3862600
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions allsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2133,6 +2133,7 @@ var ALLSETTINGS = {
},
"MISSION_PLANER": {},
"ANALOG": {
"board_vcc": 0,
"voltage": 0,
"mAhdrawn": 5,
"mWhdrawn": 0,
Expand Down
1 change: 1 addition & 0 deletions js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ var FC = {
MISSION_PLANER = new WaypointCollection();

ANALOG = {
board_vcc: 0,
voltage: 0,
mAhdrawn: 0,
mWhdrawn: 0,
Expand Down
4 changes: 2 additions & 2 deletions js/mavsp/MAVSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ var mspHelper = (function (gui) {
Vcc: 5122
*/
CONFIG.i2cError = mavmsg.I2Cerr;
ANALOG.voltage = mavmsg.Vcc / 1000.0; // cpu volts
ANALOG.board_vcc = mavmsg.Vcc / 1000.0; // cpu volts
// buzz todo
break;
case mavlink20.MAVLINK_MSG_ID_MOUNT_STATUS:
Expand Down Expand Up @@ -449,7 +449,7 @@ var mspHelper = (function (gui) {
*/
ANALOG.battery_full_when_plugged_in = true; // buzz hardcoded hack to match ardu
ANALOG.cell_count = 4; // buzz
ANALOG.voltage = mavmsg.voltages[0] / 100.0; // buzz?
ANALOG.voltage = mavmsg.voltages[0] / 1000.0; // showing voltage from first battery only
ANALOG.amperage = mavmsg.current_battery / 100.0; //?
ANALOG.mAhdrawn = mavmsg.current_consumed;
ANALOG.battery_remaining_capacity = mavmsg.battery_remaining; //one of these is
Expand Down

0 comments on commit 3862600

Please sign in to comment.