Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Aug 14, 2024
1 parent 210ddf5 commit f3274b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- fix **float getShuntVoltage()** for negative values, kudos to aguilerabr
- add **int getMaxShuntVoltage()**, depends on GAIN (Table 7).
- removed default for **setGain()** as it was not sensors default.
- update readme.md

----

Expand Down
1 change: 1 addition & 0 deletions INA219.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ bool INA219::setGain(uint8_t factor)
}
uint16_t config = _readRegister(INA219_CONFIGURATION);
config &= ~INA219_CONF_PROG_GAIN;
// factor == 1 ==> mask = 00
if (factor == 2) config |= (1 << 11);
else if (factor == 4) config |= (2 << 11);
else if (factor == 8) config |= (3 << 11);
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ Determines the shunt voltage range. 40, 80, 160 or 320 mV.
Returns false if factor is not a valid value.
Returns false if it could not write settings to device.
- **uint8_t getGain()** returns set factor.
- **int getMaxShuntVoltage()** returns 40, 80, 160 or 320 (default).
Value in millivolts mV.
- **int getMaxShuntVoltage()** returns 40, 80, 160 or 320 (mV).
320 is the sensors default.


#### Configuration BUS and SHUNT
Expand Down

0 comments on commit f3274b0

Please sign in to comment.