claws / BH1750

An Arduino library for the digital light sensor breakout boards containing the BH1750FVI IC
MIT License
252 stars 108 forks source link

how to send sensor to sleep #47

Closed yurysvirida closed 6 years ago

yurysvirida commented 6 years ago

Hi,

How to send sensor properly to sleep ? Before I changed write8 as public and it did the trick. But new version cannot figure out how to do.

public: BH1750(); void begin(uint8_t mode = BH1750_CONTINUOUS_HIGH_RES_MODE); void configure(uint8_t mode); uint16_t readLightLevel(void);

//private: void write8(uint8_t data);

};

in the actual code I did put this:

lightMeter.write8(BH1750_POWER_DOWN);

it was working.

Lib is great, thanks!

coelner commented 6 years ago

change the mode from CONTINUOUS_XXX_RES_MODE to ONE_TIME_XXX_RES_MODE the sensor goes to sleep after a measurement. There is no direct method to force sleep down

yurysvirida commented 6 years ago

Yes. Thanks. checked it, sleeps ok.