Conversation
…into tanmay_monitor_testing Updating branch
momoka17
left a comment
There was a problem hiding this comment.
Thank you for your great work, Tanmay!
I commented for minor changes, so if you read the comment and it looks good, can you click commit changes? It will automatically commit the changes. And once you commit changes, it's good to merge this.
Also, I see vbat_row function in the test code. If the code in the source code is not working, we should fix that and delete this function. But for now, we can just merge this PR and work on those changes in the next PR!
Thank you for your work!
| // /*@brief "Stores battery properties in a map for easy acccess" | ||
|
|
||
| // @return "Returns a map of battery properties and their values in millivolts or milliamps" | ||
| // */ | ||
| // void BQ25756::BatteryMonitor::getProperties(int properties[8]) { | ||
| // properties[0] = getVac(); // VAC | ||
| // properties[1] = getVbat(); // VBAT | ||
| // properties[2] = getVfb(); // VFB | ||
| // properties[3] = readVrechg(); // VRECHG | ||
| // properties[4] = readVbat_lowv(); // VBAT_LOWV | ||
| // properties[5] = readIchg(); // ICHG | ||
| // properties[6] = getIac(); // IAC | ||
| // properties[7] = getIbat(); // IBAT | ||
| // } |
There was a problem hiding this comment.
| // /*@brief "Stores battery properties in a map for easy acccess" | |
| // @return "Returns a map of battery properties and their values in millivolts or milliamps" | |
| // */ | |
| // void BQ25756::BatteryMonitor::getProperties(int properties[8]) { | |
| // properties[0] = getVac(); // VAC | |
| // properties[1] = getVbat(); // VBAT | |
| // properties[2] = getVfb(); // VFB | |
| // properties[3] = readVrechg(); // VRECHG | |
| // properties[4] = readVbat_lowv(); // VBAT_LOWV | |
| // properties[5] = readIchg(); // ICHG | |
| // properties[6] = getIac(); // IAC | |
| // properties[7] = getIbat(); // IBAT | |
| // } |
Delete this block
| bm = new BatteryMonitor(); | ||
| } | ||
|
|
||
| void BQ25756::resetRegister() |
There was a problem hiding this comment.
| void BQ25756::resetRegister() | |
| // Reset register | |
| // Register reset to default values | |
| void BQ25756::resetRegister() |
Add commit changes like this :)
There was a problem hiding this comment.
(Just note for us) Need to replace the i2c.cpp in src because this is the correct file.
| b2.adc.enableADCReadingForOneshot(); | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
| // Report all ADC measurements and charging status |
Need a function comment like this
| printf("printf now works!\n"); | ||
| // Check the wiring I2C to set up test correctly | ||
| Wire.begin(); | ||
| Wire.beginTransmission(0x6B); |
There was a problem hiding this comment.
| Wire.beginTransmission(0x6B); |
Deleted this function because this is not needed.
| } | ||
|
|
||
| void loop() { | ||
| delay(500); |
There was a problem hiding this comment.
| delay(500); | |
| delay(500); |
Indent fix
| void printVBAT_LOWV() { | ||
| uint8_t data = read8bitRegister(PRECHARGE_TERM_CONT); | ||
| uint8_t bit2_1Value = (data & 0x06) >> 1; | ||
| printf("VBAT_LOW is "); | ||
| printf("%d \n", bit2_1Value); //fix this | ||
| } |
There was a problem hiding this comment.
I wonder what the purpose of the function here is. The vbat_low function in the main code is not working? We could merge this PR with this function, but please create another PR to remove or fix the function!
| //Test the Monitor functions | ||
| reportStatus(); | ||
| delay(500); | ||
| printVBAT_LOWV(); |
| @@ -0,0 +1,39 @@ | |||
| // Write test code here and call the function in .ino file to run the test | |||
There was a problem hiding this comment.
| // Write test code here and call the function in .ino file to run the test |
No description provided.