From a8861827dda0746cec38ee27b6237a5525c68b27 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Mon, 22 Apr 2024 17:35:33 +0200 Subject: [PATCH] bump version 0.3.1 (#18) - Bump version after Fix #17, Kudos to ChrisRed255 --- CHANGELOG.md | 4 ++++ INA219.cpp | 14 +++++++------- INA219.h | 4 ++-- library.json | 2 +- library.properties | 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af20d17..d8c26bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.1] - 2024-04-22 +- Bump version after Fix #17, Kudos to ChrisRed255 + + ## [0.3.0] - 2024-03-15 - Fix #14, change round to truncate. - update GitHub actions to v4 diff --git a/INA219.cpp b/INA219.cpp index 258dab6..8bcf070 100644 --- a/INA219.cpp +++ b/INA219.cpp @@ -1,6 +1,6 @@ // FILE: INA219.h // AUTHOR: Rob Tillaart -// VERSION: 0.3.0 +// VERSION: 0.3.1 // DATE: 2021-05-18 // PURPOSE: Arduino library for INA219 voltage, current and power sensor // URL: https://github.com/RobTillaart/INA219 @@ -40,7 +40,7 @@ INA219::INA219(const uint8_t address, TwoWire *wire) { _address = address; _wire = wire; - // not calibrated values by default. + // no calibrated values by default. _current_LSB = 0; _maxCurrent = 0; _shunt = 0; @@ -75,7 +75,7 @@ uint8_t INA219::getAddress() float INA219::getShuntVoltage() { uint16_t value = _readRegister(INA219_SHUNT_VOLTAGE); - return value * 1e-5; // fixed 10 uV + return value * 1e-5; // fixed 10 uV } @@ -85,8 +85,8 @@ float INA219::getBusVoltage() uint8_t flags = value & 0x03; // math overflow handling if (flags & 0x01) return -100; - // if flags && 0x02 ==> convert flag; not handled - float voltage = (value >> 3) * 4e-3; // fixed 4 mV + // if flags && 0x02 ==> convert flag; not handled + float voltage = (value >> 3) * 4e-3; // fixed 4 mV return voltage; } @@ -94,7 +94,7 @@ float INA219::getBusVoltage() float INA219::getPower() { uint16_t value = _readRegister(INA219_POWER); - return value * _current_LSB * 20; + return value * (_current_LSB * 20); // fixed 20 Watt } // TODO CHECK @@ -129,7 +129,7 @@ bool INA219::reset() uint16_t config = _readRegister(INA219_CONFIGURATION); config |= 0x8000; uint16_t wrrv = _writeRegister(INA219_CONFIGURATION, config); - // reset calibration + // reset calibration _current_LSB = 0; _maxCurrent = 0; _shunt = 0; diff --git a/INA219.h b/INA219.h index 48d8298..772e6f3 100644 --- a/INA219.h +++ b/INA219.h @@ -1,7 +1,7 @@ #pragma once // FILE: INA219.h // AUTHOR: Rob Tillaart -// VERSION: 0.3.0 +// VERSION: 0.3.1 // DATE: 2021-05-18 // PURPOSE: Arduino library for INA219 voltage, current and power sensor // URL: https://github.com/RobTillaart/INA219 @@ -13,7 +13,7 @@ #include "Wire.h" -#define INA219_LIB_VERSION (F("0.3.0")) +#define INA219_LIB_VERSION (F("0.3.1")) class INA219 diff --git a/library.json b/library.json index 4a86100..f6faccf 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/INA219.git" }, - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index 0a2aa9c..99a7b64 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=INA219 -version=0.3.0 +version=0.3.1 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for INA219 voltage, current and power sensor.