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
04_PowerMonitor/batt_guage.cpp@30:44676e1b38f8, 2018-03-20 (annotated)
- Committer:
- ahmed_lv
- Date:
- Tue Mar 20 05:56:22 2018 +0000
- Revision:
- 30:44676e1b38f8
- Parent:
- 11:49344285c82a
Editted Input Variables to PID
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
akashvibhute | 11:49344285c82a | 1 | #include "batt_guage.h" |
akashvibhute | 11:49344285c82a | 2 | BattGuage::BattGuage():batt_gauge(i2c_SDA, i2c_SCL) |
akashvibhute | 11:49344285c82a | 3 | { |
akashvibhute | 11:49344285c82a | 4 | batt_gauge.open(); |
akashvibhute | 11:49344285c82a | 5 | batt_gauge.compensation(MAX17048::RCOMP0); //Load the default compensation value |
akashvibhute | 11:49344285c82a | 6 | } |
akashvibhute | 11:49344285c82a | 7 | |
akashvibhute | 11:49344285c82a | 8 | void BattGuage::reset() |
akashvibhute | 11:49344285c82a | 9 | { |
akashvibhute | 11:49344285c82a | 10 | batt_gauge.reset(); |
akashvibhute | 11:49344285c82a | 11 | wait(0.1); |
akashvibhute | 11:49344285c82a | 12 | } |
akashvibhute | 11:49344285c82a | 13 | |
akashvibhute | 11:49344285c82a | 14 | float BattGuage::getSOC() |
akashvibhute | 11:49344285c82a | 15 | { |
akashvibhute | 11:49344285c82a | 16 | return(batt_gauge.soc()); |
akashvibhute | 11:49344285c82a | 17 | } |
akashvibhute | 11:49344285c82a | 18 | |
akashvibhute | 11:49344285c82a | 19 | float BattGuage::getVcell() |
akashvibhute | 11:49344285c82a | 20 | { |
akashvibhute | 11:49344285c82a | 21 | return(batt_gauge.vcell()); |
akashvibhute | 11:49344285c82a | 22 | } |