Zanduino / INA

Combined Arduino library for reading multiple INA2xx power monitor devices
GNU General Public License v3.0
158 stars 41 forks source link

getId() to return dec/Hex value of the Id #38

Closed novski closed 5 years ago

novski commented 5 years ago

Is your feature request related to a problem? Please describe. i can not allways determine which INA219 is read as Id's are incrementaly created.

Describe the solution you'd like I wold like to see the example displayreadings.ino to show the Hexadecimal or Decimal id of the read shunt.

Describe alternatives you've considered Don't know if thats possible. No alternatives.

Additional context bildschirmfoto 2019-02-08 um 13 39 38

bildschirmfoto 2019-02-08 um 13 41 24
SV-Zanshin commented 5 years ago

That should be possible to add. Let me look into that.

SV-Zanshin commented 5 years ago

I have added a new library method, "getDeviceAddress()" which returns the device's I2C address. I've also updated the DisplayReadings.ino example program to include displaying the address. Unfortunately, I cannot find my breadboard which has all the different I2C devices installed for testing.

Although this change was trivial, I would appreciate it if you could do the test to see if it functions correctly and post the results to this issue.

Thanks.

SV-Zanshin commented 5 years ago

I've also changed the comments around in the library, moving all the doxygen comments from the .h to the .cpp

SV-Zanshin commented 5 years ago

I found my INA226 lying around and checked the changes.

novski commented 5 years ago

Hi, im sorry i was not available shortly. I now checked on my side as well and it works great. Decimal Address is the best choice! Thanks a lot!