claws / BH1750

An Arduino library for the digital light sensor breakout boards containing the BH1750FVI IC
MIT License
252 stars 108 forks source link

The Wire.requestFrom() does not need beginTransmission() and endTransmission(). #10

Closed Koepel closed 7 years ago

Koepel commented 7 years ago

In file BH1750.cpp, in the function readLightLevel(), the Wire.requestFrom() is encapsulated by Wire.beginTransmission and Wire.endTransmission(). That is not correct use of the Wire library, since the Wire.beginTransmission and Wire.endTransmission should only be used when writing data. The Wire.requestFrom() is a complete I2C transaction on its own.

claws commented 7 years ago

Fixed. Thanks.