mirror of
https://github.com/claws/BH1750.git
synced 2026-07-28 04:06:05 +00:00
Merge pull request #11 from claws/remove_unnecessary_wire_calls
Fix for #10
This commit is contained in:
@@ -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: "));
|
||||
|
||||
Reference in New Issue
Block a user