flav1972 / ArduinoINA219

An Arduino library for the INA219 I2C current monitor
17 stars 16 forks source link

No need to call TwoWire::endTransmission() when reading values #5

Closed ulysse314 closed 5 years ago

ulysse314 commented 5 years ago

TwoWire::endTransmission() should not be called.

flav1972 commented 5 years ago

endTransmission is mandatory to be sure all Write is pushed on the bus.

ulysse314 commented 5 years ago

There is no beginTransmission. If you are talking about this write: https://github.com/flav1972/ArduinoINA219/blob/master/INA219.cpp#L289

This write contains both begin and end. Therefore in the read method begin is called once, and end is called twice.