adafruit / Adafruit_VEML6070

Arduino Library for VEML6070 Digital UV sensors
14 stars 19 forks source link

Please include sleep functionality of VEML6070 #2

Closed manutremo closed 6 years ago

manutremo commented 7 years ago

Hi,

I'm proposing to expand the library to include the sleep functionality of the VEML6070 module.

I'm working on a battery powered device which includes the VEML6070. I measured the consumption to be aproxaimtely 60 uA constant - not too high but it can't be reduced by using the sleep mode in the chip.

I created a function sleep(mode) - mode = true puts the module to sleep, while mode = false wakes it up.

The config register can't be read so the config byte needs to be stored in a variable, which is then modified and re-written to the register after every change.

I hope this contribution is well received!

Manuel

ladyada commented 7 years ago

neat, no ETA on testing, but others can try it out for sure, we'll leave this open :)

deanm1278 commented 6 years ago

I've implemented in a slightly different way: https://github.com/adafruit/Adafruit_VEML6070/commit/b236d0360c470eb36a91aed60058a991ebc59ede

use Adafruit_VEML6070::sleep(true) to enter sleep mode, Adafruit_VEML6070::sleep(false) to wake up. Thanks for the help!