Merge pull request #11 from claws/remove_unnecessary_wire_calls

Fix for #10
This commit is contained in:
claws
2017-01-04 10:11:26 +10:30
committed by GitHub
-6
View File
@@ -120,9 +120,6 @@ uint16_t BH1750::readLightLevel(void) {
// Measurment result will be stored here
uint16_t level;
// Start transmission to sensor
Wire.beginTransmission(BH1750_I2CADDR);
// Read two bytes from sensor
Wire.requestFrom(BH1750_I2CADDR, 2);
@@ -131,9 +128,6 @@ uint16_t BH1750::readLightLevel(void) {
level <<= 8;
level |= __wire_read();
// Say goodbye!
Wire.endTransmission();
// Send raw value if debug enabled
#ifdef BH1750_DEBUG
Serial.print(F("[BH1750] Raw value: "));