By javier.galindo
#45813
Hello

I just started tu use the I2C Wattmeter INA219...

In my first test I measured a bus bar voltage above 15V... let's say 18V... well below the 26 VMax...
The fact is that, when reading this voltage with the example provided within your library, I see a negative value...
I have been reviewing the library and I think this comes from the int16_t that is used in the library in
int16_t DFRobot_INA219::readInaReg(uint8_t reg)
I think this results from a defective cast from int16 to float... for values above aprox 16V the cast overflow due to the signed int that it is returned by the library... when modifying the library to use uint16 instead of int it worked pretty well...
Could you confirm that there won't be any side effects with this change in the library?

Thanks