Light
Python Library for Broadcom APDS-9960 Ambient & RGB Light, Proximity and Gesture Detection Sensor.
Python Library
Turta_Light library is responsible for reading light, proximity and detecting gesture from the APDS-9960 sensor.
Initialization
Add the following statement to the top of your Python code.
Then, create an instance of the LightSensor class.
Now you're ready to access the library by calling its instance.
Initialization Parameters
LightSensor
Initiates the APDS-9960 sensor to get ambient light, RGB light, proximity and gesture data.
Parameters
MODES mode: Sensor operating mode. (MODES.ALS_RGB is default.)
Bool pypass_int: Enables checking gesture interrupt without using the interrupt pin. Decreases performance on incorrect use. Only set True if you're listening the interrupt pin on the main application code. (False is default.)
Basic Members
Read Ambient Light
Reads the ambient light value.
Parameters
None
Returns
Int: Ambient light value.
Read Clear and RGB Light
Reads the CRGB light values.
Parameters
None
Returns
Int[]: Clear, red, green and blue light values respectively.
Read Proximity
Reads the proximity value.
Parameters
None
Returns
Byte: Proximity value.
Read Gesture
Detects hand gestures.
Parameters
None
Returns
GESTURES: Gesture direction if gesture is detected, None if not.
Advanced Members
Set Mode
Sets the sensor mode.
Parameters
MODES mode: Sensor operating mode.
Returns
None
Finalizer
When exiting from the program, the library turns off the sensor and releases the GPIO pin.
Last updated