From f3274b071ee725534a62b8a557ddc3f6847c7f35 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Wed, 14 Aug 2024 17:32:32 +0200 Subject: [PATCH] minor edits --- CHANGELOG.md | 1 + INA219.cpp | 1 + README.md | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d72e13..75cc74b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ---- diff --git a/INA219.cpp b/INA219.cpp index df5a419..d791d00 100644 --- a/INA219.cpp +++ b/INA219.cpp @@ -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); diff --git a/README.md b/README.md index 18d6a97..bfa8c04 100644 --- a/README.md +++ b/README.md @@ -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