jarzebski / Arduino-INA226

INA226 Bi-directional Current/Power Monitor Arduino Librar
MIT License
48 stars 46 forks source link

unnecessary code while useing Wire library #3

Closed Alex-Ga closed 1 year ago

Alex-Ga commented 7 years ago

Wire.requestFrom(...) should not be encapsulated by a Transmission. The begin/end Transmission is only needed for sending data to a I²C slave by send(). https://playground.arduino.cc/Main/WireLibraryDetailedReference#beginTransmission

while(!Wire.available()) {}; is also not needed. When Wire.requestFrom() has returned the I2C transmission has ended and the data is in the buffer.

N0ury commented 1 year ago

You are right. The begin transmission makes now an esp32-s2 hang.

So we can say "should not be encapsulated"

jarzebski commented 1 year ago

solved in next release