Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing sleep mode to improve power consumption #12

Open
bonjour81 opened this issue Mar 28, 2019 · 0 comments
Open

Missing sleep mode to improve power consumption #12

bonjour81 opened this issue Mar 28, 2019 · 0 comments

Comments

@bonjour81
Copy link

Hi!
I found a "sleep" function for VEML6075 in my code but cannot remember how I get this.
Currently, I do not see any sleep function in the library.

Could we add this ? (I'm too noob to dare pull some request or whatever, I have no idea how to do it)

I found a piece of code in this forum:
https://forum.mysensors.org/topic/6952/veml6070-and-veml6075-uv-sensors/25

in the .h:
void sleep(bool mode);

in the .cpp:
`void VEML6075::sleep(bool mode) {

if (mode) 
	this->config |= 1; // Go to sleep			
else 
	this->config &= 254; // Wake up

this->write16(VEML6075_REG_CONF, this->config);

}`

I cannot test today, but the code seems fine to me as the datasheet state that bit 0 of command register 00 as "SD" bit (ShutDown):
enable = 0 , Shutdown = 1

If possible, I would suggest to replace value with hex: 0xFE is more clear than 254 in such situation (imho)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant