Implement new controller
Dependencies: mbed-rtos mbed QEI BNO055 MPU6050_DMP_Nucleo-I2Cdev virgo3_imuHandler_Orion_PCB MAX17048 Servo
Fork of Orion_newPCB_test by
Diff: 04_PowerMonitor/batt_guage.cpp
- Revision:
- 4:315716ef8178
- Parent:
- 2:761e3c932ce0
diff -r d714e97266a3 -r 315716ef8178 04_PowerMonitor/batt_guage.cpp --- a/04_PowerMonitor/batt_guage.cpp Mon Jan 18 09:07:39 2016 +0000 +++ b/04_PowerMonitor/batt_guage.cpp Wed Jan 20 04:01:37 2016 +0000 @@ -0,0 +1,22 @@ +#include "batt_guage.h" +BattGuage::BattGuage():batt_gauge(i2c_SDA, i2c_SCL) +{ + batt_gauge.open(); + batt_gauge.compensation(MAX17048::RCOMP0); //Load the default compensation value +} + +void BattGuage::reset() +{ + batt_gauge.reset(); + wait(0.1); +} + +float BattGuage::getSOC() +{ + return(batt_gauge.soc()); +} + +float BattGuage::getVcell() +{ + return(batt_gauge.vcell()); +} \ No newline at end of file