Skip to content

Remove unnecessary register read for triggered measurement & new function getConversionReady

Compare
Choose a tag to compare
@wollewald wollewald released this 31 Jan 22:20
· 10 commits to master since this release
9ac6dfb

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).