Releases: wollewald/INA219_WE
Stop example sketches in case of no connection
Fixed: Correction factor was lost when changing gain factor
Correction factor was lost when changing gain factor. I fixed this now.
Corrected a typo in the function list
No change to the code. Just corrected:
getBusPower_mW() --> getBusPower()
in the function list (pdf-file).
Remove unnecessary register read for triggered measurement & new function getConversionReady
Reading the INA219_BUS_REG did not clear the CNVR flag. Reading the INA219_PWR_REG instead will clear the CNVR flag. Since the INA219_CONF_REG is written afterwards anyways, even a read of the INA219_PWR_REG is unnecessary. Checked the behaviour with the Triggerd example and everything seems to be fine.
Also I added the function getConversionReady. It enables you to check if new values are available in continuous mode to then act accordingly. The CNVR flag is reset by calling readRegister(INA219_PWR_REG).
Syntax Highlighting of getBusVoltage_V did not work
Syntax Highlighting of getBusVoltage_V did not work due to a typo.
Replaced #define by constexpr
Various changes:
- Replaced #define by constexpr
- Replaced C-Cast by static_cast
- Tidied constructors
- Replaced private by protected
getShuntVoltage() did not include the offset
getShuntSize() did not include the shunt offset. I have changed that.
Amended the ATtiny example sketch
The update of the displayed values is nicer now.
Ability to run on ATtinys
I have added the option to use the library on an ATtiny. I have tested it on an ATtiny85. For this you need to change from Wire.h to TinyWireM.h from Adafruit. I added an example sketch.
Offset Function added
People have reported offsets, that means shunt voltages that occur although there is no current (load device switched off). With the new function setShuntVoltOffset_mV(offset), you can correct this.