Light sensor Interrupt callback
Answer
10/12/18 6:13 AM

Hi, 

I am using the StreamSensorDataOverUSB example and have turned on the Light sensor. In that example, in the sensor setup configuration interrupt is enabled for the light sensor and a callback function is registered for the same.

My query is that what is the use of interrupt in light sensor and when does that interrupt callback is executed. I can't find any documentation for the same. And if that interrupt callback is an indictaion of some error condition then how can I resolve that.

Thanks

Niti

0 (0 Votes)
RE: Light sensor Interrupt callback
Answer
10/12/18 2:42 PM as a reply to Niti Rohilla.
Hello Niti,

The StreamSensorDataOverUsb examples showcases how to stream data from the different XDK sensors to the XDK-Workbench console. Furthermore, it utilizes the interrupt functionality for the light sensor and the accelerometer BMA280.

Generally, it is not necessary to use an interrupt to receive the data from the light sensor.

The interrupt itself is no indication of any kind of error and executes only when a certain event is triggered such as if an upper or lower threshold is reached. This means in case of the light sensor, that if the light intensity exceeds or falls throw a defined threshold for a defined period of time, an interrupt will be triggered.

To use the interrupt correctly, the data from the light sensor would then need to be read every time the callback function for the light sensor interrupt was triggered to catch the triggering sensor value.

Please tell me if this was helpful, and feel free to ask further questions.

Kind regards,
Franjo
0 (0 Votes)
RE: Light sensor Interrupt callback
Answer
10/16/18 3:34 AM as a reply to Franjo Stjepandic.
Thanks Franjo, this information was helpful.
0 (0 Votes)
RE: Light sensor Interrupt callback
Answer
10/16/18 3:16 PM as a reply to Niti Rohilla.
Hello Niti,

I am glad to hear that my input was helpful.

Please feel free to ask if you have any kind of further questions.

Kind regards,
Franjo
0 (0 Votes)