Digital 16bit Serial Output Type Ambient Light Sensor IC by ROHM, Ambient light sensor (Illuminance to digital converter). Forked from Kenji Arai BH1750, minor changes.
Diff: BH1750.h
- Revision:
- 5:04cdce6242a6
- Parent:
- 4:47d7e70dc9b8
diff -r 47d7e70dc9b8 -r 04cdce6242a6 BH1750.h --- a/BH1750.h Fri Sep 13 14:22:17 2019 +0000 +++ b/BH1750.h Mon Jan 17 12:55:09 2022 +0000 @@ -44,11 +44,11 @@ #define CMD_M_TIME_L 0x60 ////////////// SENSITIVITY //////////////////////////////// -#define SENS_1R00 69 //Default -#define SENS_3R68 254 //High Sensitivity -#define SENS_0R45 31 -#define SENS_2R00 138 -#define SENS_0R50 35 +#define SENS_2 69 //Default +#define SENS_4 254 //High Sensitivity +#define SENS_0 31 +#define SENS_3 138 +#define SENS_1 35 /** Interface for Luminosity sensor, BH1750 //@code @@ -94,23 +94,46 @@ * @return Lux */ float lux(void); + + void set_sensitivity(uint8_t parameter); + + float high_resolution2_trigger_read(); + + float high_resolution_trigger_read(); + + float low_resolution_trigger_read(); + + void high_resolution2_trigger(); + + void high_resolution_trigger(); + + void low_resolution_trigger(); + + float high_resolution2_read(); + + float high_resolution_read(); + + float low_resolution_read(); /** Set sensor to high resolution mode * @param sensitivity parameter * @return none */ - void set_high_resolution(uint8_t parameter); + void set_high_resolution_continuous(uint8_t parameter); /** Set sensor to high resolution mode * @param sensitivity parameter * @return none */ - void set_high_resolution_2(uint8_t parameter); + void set_high_resolution2_continuous(uint8_t parameter); /** Set I2C clock frequency * @param freq. * @return none */ + + void set_low_resolution_continuous(uint8_t parameter); + void frequency(int hz); /** Power Up/Down @@ -119,6 +142,8 @@ */ void power_up(void); void power_down(void); + + void reset(void); protected: I2C *_i2c_p;