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

Sleep or Reset function dont work #1

Open
alco28 opened this issue Apr 22, 2014 · 3 comments
Open

Sleep or Reset function dont work #1

alco28 opened this issue Apr 22, 2014 · 3 comments

Comments

@alco28
Copy link

alco28 commented Apr 22, 2014

I can't get the sleep and reset (power_on) function working. Can you look at that for an example? I use:

void loop() {
// put your main code here, to run repeatedly:
LightSensor.Reset();
delay(4000); // played with it..don't work..
uint16_t lux = LightSensor.GetLightIntensity();// Get Lux value
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lux");

LightSensor.Sleep(); //sleep it
delay(6000);
}

@sej7278
Copy link

sej7278 commented Sep 15, 2015

i find that Sleep() works fine and takes the current down from 112uA to 5uA, but it never wakes up again after a Reset() and always returns 0, the same happens if you use the ONETIME_* methods, as they also automatically sleep the device after taking a reading.

the library seems to be much the same as a lot of other libraries on other platforms, so i can only assume its something to do with the way the arduino Wire library works or the i2c pullups....?

oddly enough when connecting a multimeter, when the module goes to sleep it seems to reverse the polarity or direction of current flow or something odd as the meter reads -25uA sometimes.

@Genotronex
Copy link
Owner

Maybe call function error .
do you use any other I2C device with your project ?

Mohannad.B.Rawashdeh
Genotronex Electronics -Amman-Jordan
Tel : 0962786739233

On Tue, Sep 15, 2015 at 2:43 PM, Simon John [email protected]
wrote:

i find that Sleep() works fine, but it never wakes up again after a Reset()


Reply to this email directly or view it on GitHub
#1 (comment)
.

@sej7278
Copy link

sej7278 commented Sep 27, 2015

i found the problem.

when using one of the onetime modes e.g. lightMeter.SetMode(OneTime_H_resolution_Mode); or calling lightMeter.Sleep(); you can't just wake again using lightMeter.Reset(); you have to set the resolution mode again e.g. lightMeter.SetMode(OneTime_H_resolution_Mode);

so it may be worth documenting that to wake you should call:

lightMeter.Reset();
lightMeter.SetMode(uint8_t MODE);

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

3 participants