Pluto-IDE is the professional development environment required to build, flash, and monitor firmware using the MagisV2 library on Pluto Drones.
Battery Management System interface for monitoring battery parameters.
BMS_Option_etypedef enum BMS_Option {
Voltage, // Battery voltage
Current, // Current flow through battery
mAh_Consumed, // Milliampere-hours consumed
mAh_Remain, // Milliampere-hours remaining
Battery_Capicity, // Total battery capacity
Estimated_Capacity // Estimated battery capacity
} BMS_Option_e;
uint16_t Bms_Get(BMS_Option_e _bms_option)Retrieves battery management system parameters.
Parameters:
_bms_option - BMS parameter to retrieveReturns: Value of requested parameter (0 if invalid)
void Bms_Using_Other_Battery(uint16_t _new_cap_mAh)Updates battery capacity with new value.
Parameters:
_new_cap_mAh - New battery capacity in mAh// Monitor battery status
uint16_t voltage = Bms_Get(Voltage);
uint16_t remaining = Bms_Get(mAh_Remain);
uint16_t capacity = Bms_Get(Battery_Capicity);
// Calculate percentage
uint8_t percentage = (remaining * 100) / capacity;
// Update for different battery
Bms_Using_Other_Battery(2200);
// Low battery check
if (percentage < 20) {
Monitor_Println("Low Battery Warning");
}
