Light sensor

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
giovag7
Posts: 58
Joined: 05 Mar 2013 10:02

Light sensor

Post by giovag7 » 08 Mar 2013 14:31

Hi Martin,
i noticed that trigger "light sensor" give variable light_level only when there is a transition above or below selected threshold.
But if i need to know light level at any time, how can i do this?
I think would be better to have a component that can give light level at any moment.

http://automagic4android.com/en/help/co ... ght_sensor

Regards

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Light sensor

Post by Martin » 08 Mar 2013 14:51

Perhaps you could create two triggers, one that triggers when the sensor is above a certain value and one that triggers when the value falls below this value and store the result in a global variable. But this will keep the sensor awake all the time and is not optimal for battery consumption.
I have to check if the light sensor allows to query the current value to create a condition.

User avatar
giovag7
Posts: 58
Joined: 05 Mar 2013 10:02

Re: Light sensor

Post by giovag7 » 08 Mar 2013 15:09

Martin wrote:Perhaps you could create two triggers, one that triggers when the sensor is above a certain value and one that triggers when the value falls below this value and store the result in a global variable. But this will keep the sensor awake all the time and is not optimal for battery consumption.
I have to check if the light sensor allows to query the current value to create a condition.
Thank you,
no i don't want to keep sensor allway on.
If is possible to obtain light sensor value at any moment this would be the best solution.

Post Reply