adafruit / Adafruit-BMP085-Library

A powerful but easy to use BMP085/BMP180 Arduino library
http://www.adafruit.com/products/1603
233 stars 194 forks source link

Wire.endTransmission after Wire.requestFrom is not okay. #17

Closed Koepel closed 3 years ago

Koepel commented 9 years ago

In two places there is a Wire.endTransmission after a Wire.requestFrom. The Wire.requestFrom is a complete I2C transmission on its own, it should not be followed by a Wire.endTransmission. The Wire.endTransmission transmits the bytes in the buffer that are written with Wire.write and waits until the I2C transmission (to write date) has finished.

nkolban commented 8 years ago

Worse ... I seem to see a Wire.beginTransmission() which starts a write immediately followed by a Wire.requestFrom() ... which is used to read from the bus ... something smells awfully fishy here.

ladyada commented 3 years ago

resolved, using BusIO