treymarc / multiwii-mavlink-gc

Multiwii Mavlink GroundControl
24 stars 15 forks source link

mwgc: fix battery voltage conversion #10

Closed koenkooi closed 10 years ago

koenkooi commented 10 years ago

MultiWii types.h says:

typedef struct { uint8_t vbat; // battery voltage in 0.1V steps uint16_t intPowerMeterSum; uint16_t rssi; // range: [0;1023] uint16_t amperage; } analog_t;

Which is deciVolt instead of Volt.

Mavlink has:

voltage_battery uint16_t Battery voltage, in millivolts (1 = 1 millivolt)

So multiply by 100 instead of 1000. Compile tested only.

Signed-off-by: Koen Kooi koen@dominion.thruhere.net