diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f689de..a44b135 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,10 +60,10 @@ include_directories(${LIB_SRC_DIR}) generate_arduino_library( ${PROJECT_NAME}Lib SRCS - ${LIB_SRC_DIR}/BH1750.cpp + ${LIB_SRC_DIR}/ErriezBH1750.cpp HDRS - ${LIB_SRC_DIR}/BH1750.h - ${LIB_SRC_DIR}/BH1750_priv.h + ${LIB_SRC_DIR}/ErriezBH1750.h + ${LIB_SRC_DIR}/ErriezBH1750_regs.h ) # Configure project diff --git a/README.md b/README.md index 5dcdf8b..3f8e550 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Examples | Erriez BH1750: ```c++ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) @@ -154,7 +154,7 @@ Light: 667.5 LUX ```c++ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/examples/ContinuesMode/BH1750ContinuesAsynchronous/BH1750ContinuesAsynchronous.ino b/examples/ContinuesMode/BH1750ContinuesAsynchronous/BH1750ContinuesAsynchronous.ino index 7982181..1df7d58 100644 --- a/examples/ContinuesMode/BH1750ContinuesAsynchronous/BH1750ContinuesAsynchronous.ino +++ b/examples/ContinuesMode/BH1750ContinuesAsynchronous/BH1750ContinuesAsynchronous.ino @@ -30,7 +30,7 @@ */ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/examples/ContinuesMode/BH1750ContinuesBasic/BH1750ContinuesBasic.ino b/examples/ContinuesMode/BH1750ContinuesBasic/BH1750ContinuesBasic.ino index de24844..ad28129 100644 --- a/examples/ContinuesMode/BH1750ContinuesBasic/BH1750ContinuesBasic.ino +++ b/examples/ContinuesMode/BH1750ContinuesBasic/BH1750ContinuesBasic.ino @@ -30,7 +30,7 @@ */ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/examples/ContinuesMode/BH1750ContinuesHighResolution/BH1750ContinuesHighResolution.ino b/examples/ContinuesMode/BH1750ContinuesHighResolution/BH1750ContinuesHighResolution.ino index 95c45be..eb1e9be 100644 --- a/examples/ContinuesMode/BH1750ContinuesHighResolution/BH1750ContinuesHighResolution.ino +++ b/examples/ContinuesMode/BH1750ContinuesHighResolution/BH1750ContinuesHighResolution.ino @@ -30,7 +30,7 @@ */ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/examples/ContinuesMode/BH1750ContinuesLowResolution/BH1750ContinuesLowResolution.ino b/examples/ContinuesMode/BH1750ContinuesLowResolution/BH1750ContinuesLowResolution.ino index a5bfa6e..c794749 100644 --- a/examples/ContinuesMode/BH1750ContinuesLowResolution/BH1750ContinuesLowResolution.ino +++ b/examples/ContinuesMode/BH1750ContinuesLowResolution/BH1750ContinuesLowResolution.ino @@ -30,7 +30,7 @@ */ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/examples/ContinuesMode/BH1750ContinuesPowerMgt/BH1750ContinuesPowerMgt.ino b/examples/ContinuesMode/BH1750ContinuesPowerMgt/BH1750ContinuesPowerMgt.ino index dbeeb08..730701b 100644 --- a/examples/ContinuesMode/BH1750ContinuesPowerMgt/BH1750ContinuesPowerMgt.ino +++ b/examples/ContinuesMode/BH1750ContinuesPowerMgt/BH1750ContinuesPowerMgt.ino @@ -30,7 +30,7 @@ */ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/examples/OneTimeMode/BH1750OneTimeBasic/BH1750OneTimeBasic.ino b/examples/OneTimeMode/BH1750OneTimeBasic/BH1750OneTimeBasic.ino index 3694590..8d0a835 100644 --- a/examples/OneTimeMode/BH1750OneTimeBasic/BH1750OneTimeBasic.ino +++ b/examples/OneTimeMode/BH1750OneTimeBasic/BH1750OneTimeBasic.ino @@ -30,7 +30,7 @@ */ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/examples/OneTimeMode/BH1750OneTimeHighResolution/BH1750OneTimeHighResolution.ino b/examples/OneTimeMode/BH1750OneTimeHighResolution/BH1750OneTimeHighResolution.ino index 4bd19eb..3043b16 100644 --- a/examples/OneTimeMode/BH1750OneTimeHighResolution/BH1750OneTimeHighResolution.ino +++ b/examples/OneTimeMode/BH1750OneTimeHighResolution/BH1750OneTimeHighResolution.ino @@ -30,7 +30,7 @@ */ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/examples/OneTimeMode/BH1750OneTimeLowResolution/BH1750OneTimeLowResolution.ino b/examples/OneTimeMode/BH1750OneTimeLowResolution/BH1750OneTimeLowResolution.ino index bb3d842..30ce168 100644 --- a/examples/OneTimeMode/BH1750OneTimeLowResolution/BH1750OneTimeLowResolution.ino +++ b/examples/OneTimeMode/BH1750OneTimeLowResolution/BH1750OneTimeLowResolution.ino @@ -30,7 +30,7 @@ */ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/examples/OneTimeMode/BH1750OneTimePowerMgt/BH1750OneTimePowerMgt.ino b/examples/OneTimeMode/BH1750OneTimePowerMgt/BH1750OneTimePowerMgt.ino index 87b5df6..b288890 100644 --- a/examples/OneTimeMode/BH1750OneTimePowerMgt/BH1750OneTimePowerMgt.ino +++ b/examples/OneTimeMode/BH1750OneTimePowerMgt/BH1750OneTimePowerMgt.ino @@ -30,7 +30,7 @@ */ #include -#include +#include // ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default] // ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit) diff --git a/platformio/src/main.cpp b/platformio/src/main.cpp index eba571b..2e72bd3 100644 --- a/platformio/src/main.cpp +++ b/platformio/src/main.cpp @@ -28,7 +28,7 @@ * https://github.com/Erriez/ErriezDHT22 */ -#include +#include // Connect DTH22 data pin to Arduino DIGITAL pin #define DHT22_PIN 2 diff --git a/src/BH1750.cpp b/src/ErriezBH1750.cpp similarity index 98% rename from src/BH1750.cpp rename to src/ErriezBH1750.cpp index 9ebd1e6..ef529f7 100644 --- a/src/BH1750.cpp +++ b/src/ErriezBH1750.cpp @@ -23,15 +23,15 @@ */ /*! - * \file BH1750.cpp + * \file ErriezBH1750.cpp * \brief BH1750 digital light sensor library for Arduino. * \details * Source: https://github.com/Erriez/ErriezBH1750 * Documentation: https://erriez.github.io/ErriezBH1750 */ -#include "BH1750.h" -#include "BH1750_priv.h" +#include "ErriezBH1750.h" +#include "ErriezBH1750_regs.h" /*! * \brief diff --git a/src/BH1750.h b/src/ErriezBH1750.h similarity index 95% rename from src/BH1750.h rename to src/ErriezBH1750.h index ece0f6b..6e5fd76 100644 --- a/src/BH1750.h +++ b/src/ErriezBH1750.h @@ -23,15 +23,15 @@ */ /*! - * \file BH1750.h + * \file ErriezBH1750.h * \brief BH1750 digital light sensor library for Arduino. * \details * Source: https://github.com/Erriez/ErriezBH1750 * Documentation: https://erriez.github.io/ErriezBH1750 */ -#ifndef BH1750_H__ -#define BH1750_H__ +#ifndef ERRIEZ_BH1750_H__ +#define ERRIEZ_BH1750_H__ #include #include @@ -71,4 +71,4 @@ class BH1750 uint8_t _mode; }; -#endif // BH1750_H__ +#endif // ERRIEZ_BH1750_H__ diff --git a/src/BH1750_priv.h b/src/ErriezBH1750_regs.h similarity index 94% rename from src/BH1750_priv.h rename to src/ErriezBH1750_regs.h index 39586ee..e1edd15 100644 --- a/src/BH1750_priv.h +++ b/src/ErriezBH1750_regs.h @@ -23,17 +23,15 @@ */ /*! - * \file - * BH1750_priv.h - * \brief - * BH1750 digital light sensor library for Arduino. + * \file ErriezBH1750_regs.h + * \brief BH1750 digital light sensor library for Arduino. * \details * Source: https://github.com/Erriez/ErriezBH1750 * Documentation: https://erriez.github.io/ErriezBH1750 */ -#ifndef BH1750_PRIV_H__ -#define BH1750_PRIV_H__ +#ifndef ERRIEZ_BH1750_REGS_H_ +#define ERRIEZ_BH1750_REGS_H_ // I2C addresses (without R/W bit) #define BH1750_I2C_ADDR_L 0x23 //!< I2C address with ADDR pin low @@ -83,4 +81,4 @@ #define GET_TIMEOUT(mode) ((((mode) & BH1750_RES_MASK) == ResolutionLow) ? \ BH1750_CONV_TIME_L : BH1750_CONV_TIME_H) -#endif // BH1750_PRIV_H__ +#endif // ERRIEZ_BH1750_REGS_H_