Skip to content

Commit

Permalink
bump version 0.3.1 (#18)
Browse files Browse the repository at this point in the history
- Bump version after Fix #17, Kudos to ChrisRed255
  • Loading branch information
RobTillaart authored Apr 22, 2024
1 parent 8fec7e3 commit a886182
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions INA219.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
}


Expand All @@ -85,16 +85,16 @@ 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;
}


float INA219::getPower()
{
uint16_t value = _readRegister(INA219_POWER);
return value * _current_LSB * 20;
return value * (_current_LSB * 20); // fixed 20 Watt
}

// TODO CHECK
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions INA219.h
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=INA219
version=0.3.0
version=0.3.1
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for INA219 voltage, current and power sensor.
Expand Down

0 comments on commit a886182

Please sign in to comment.