commit
a5a800b49c
4 changed files with 8 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
html/
|
||||
Doxyfile
|
||||
.vscode/
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* I2C Driver for the INA260 I2C Current and Power sensor
|
||||
*
|
||||
* This is a library for the Adafruit INA260 breakout:
|
||||
* http://www.adafruit.com/products
|
||||
* http://www.adafruit.com/products/4226
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing products from
|
||||
|
|
@ -127,7 +127,7 @@ float Adafruit_INA260::readPower(void) {
|
|||
INA260_MeasurementMode Adafruit_INA260::getMode(void) {
|
||||
Adafruit_I2CRegisterBits mode =
|
||||
Adafruit_I2CRegisterBits(Config, 3, 0);
|
||||
return mode.read();
|
||||
return (INA260_MeasurementMode)mode.read();
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
|
|
@ -150,7 +150,7 @@ void Adafruit_INA260::setMode(INA260_MeasurementMode new_mode) {
|
|||
INA260_AveragingCount Adafruit_INA260::getAveragingCount(void){
|
||||
Adafruit_I2CRegisterBits averaging_count =
|
||||
Adafruit_I2CRegisterBits(Config, 3, 9);
|
||||
return averaging_count.read();
|
||||
return (INA260_AveragingCount)averaging_count.read();
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
|
|
@ -173,7 +173,7 @@ void Adafruit_INA260::setAveragingCount(INA260_AveragingCount count){
|
|||
INA260_ConversionTime Adafruit_INA260::getCurrentConversionTime(void){
|
||||
Adafruit_I2CRegisterBits current_conversion_time =
|
||||
Adafruit_I2CRegisterBits(Config, 3, 3);
|
||||
return current_conversion_time.read();
|
||||
return (INA260_ConversionTime)current_conversion_time.read();
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
|
|
@ -196,7 +196,7 @@ void Adafruit_INA260::setCurrentConversionTime(INA260_ConversionTime time){
|
|||
INA260_ConversionTime Adafruit_INA260::getVoltageConversionTime(void){
|
||||
Adafruit_I2CRegisterBits voltage_conversion_time =
|
||||
Adafruit_I2CRegisterBits(Config, 3, 6);
|
||||
return voltage_conversion_time.read();
|
||||
return (INA260_ConversionTime)voltage_conversion_time.read();
|
||||
}
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* I2C Driver for INA260 Current and Power sensor
|
||||
*
|
||||
* This is a library for the Adafruit INA260 breakout:
|
||||
* http://www.adafruit.com/products
|
||||
* http://www.adafruit.com/products/4226
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing products from
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Adafruit_INA260 [
|
||||
Tested and works great with the [Adafruit INA260 Breakout Board](http://www.adafruit.com/products/4226)
|
||||
|
||||
This chip uses I2C to communicate, 2 pins are required to interface
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue