From a320194cb7449cedbcb9285d55ade8b900430efd Mon Sep 17 00:00:00 2001 From: QuentinTorg Date: Fri, 18 Aug 2023 14:31:29 -0400 Subject: [PATCH] fix the default behavior of begin() so that it does not override addresses that are already set in constructor --- src/BH1750.cpp | 4 ++-- src/BH1750.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BH1750.cpp b/src/BH1750.cpp index 3eb9a5d..6b620bd 100644 --- a/src/BH1750.cpp +++ b/src/BH1750.cpp @@ -43,9 +43,9 @@ /** * Constructor - * @params addr Sensor address (0x76 or 0x72, see datasheet) + * @params addr Sensor address (0x23 or 0x5C, see datasheet) * - * On most sensor boards, it was 0x76 + * On most sensor boards, it was 0x23 */ BH1750::BH1750(byte addr) { diff --git a/src/BH1750.h b/src/BH1750.h index 12c335f..88da7b5 100644 --- a/src/BH1750.h +++ b/src/BH1750.h @@ -62,7 +62,7 @@ class BH1750 { }; BH1750(byte addr = 0x23); - bool begin(Mode mode = CONTINUOUS_HIGH_RES_MODE, byte addr = 0x23, + bool begin(Mode mode = CONTINUOUS_HIGH_RES_MODE, byte addr = 0x00, TwoWire* i2c = nullptr); bool configure(Mode mode); bool setMTreg(byte MTreg);