Skip to content

Commit

Permalink
Merge pull request #1211 from mavlink/pr-fix-examples
Browse files Browse the repository at this point in the history
examples: fix battery examples
  • Loading branch information
julianoes authored Oct 7, 2020
2 parents caeb318 + 90bd0f7 commit 3e63184
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/battery/battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ void send_battery_status(std::shared_ptr<MavlinkPassthrough> mavlink_passthrough
UINT16_MAX,
UINT16_MAX}; // mV

const uint16_t voltages_ext[4]{0, 0, 0, 0};

mavlink_message_t message;
mavlink_msg_battery_status_pack(
mavlink_passthrough->get_our_sysid(),
Expand All @@ -98,7 +100,9 @@ void send_battery_status(std::shared_ptr<MavlinkPassthrough> mavlink_passthrough
80, // battery_remaining %
3600, // time_remaining
MAV_BATTERY_CHARGE_STATE_OK,
0); // voltages_ext
voltages_ext,
MAV_BATTERY_MODE_UNKNOWN, // mode
0); // fault_bitmask

mavlink_passthrough->send_message(message);
}
Expand Down

0 comments on commit 3e63184

Please sign in to comment.