APDS9960
¶
Driver class for the APDS9960 board. Supports gesture, proximity, and color detection.
Author(s): Michael McWethy
Implementation Notes¶
Hardware:
Adafruit APDS9960 Proximity, Light, RGB, and Gesture Sensor (Product ID: 3595)
Adafruit Adafruit CLUE (Product ID: 4500)
Adafruit Adafruit Feather nRF52840 Sense (Product ID: 4516)
Adafruit Adafruit Proximity Trinkey (Product ID: 5022)
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_apds9960.apds9960.APDS9960(i2c: busio.I2C, *, address: int = 57, integration_time: int = 1, gain: int = 1, rotation: int = 0)[source]¶
APDS9900 provide basic driver services for the ASDS9960 breakout board
- Parameters
Quickstart: Importing and using the APDS9960
Here is an example of using the
APDS9960
class. First you will need to import the libraries to use the sensorimport board from adafruit_apds9960.apds9960 import APDS9960
Once this is done you can define your
board.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA apds = APDS9960(i2c)
Now you have access to the
sensor.proximity
attributeproximity = apds.proximity
- color_gain¶
Color gain value
- enable¶
Board enable. True to enable, False to disable
- enable_color¶
Color detection enable flag. True when color detection is enabled, else False
- property enable_gesture: bool¶
Gesture detection enable flag. True to enable, False to disable. Note that when disabled, gesture mode is turned off
- enable_proximity¶
Enable of proximity mode
- enable_proximity_interrupt¶
Proximity interrupt enable flag. True if enabled, False to disable
- gesture() int [source]¶
Returns gesture code if detected. =0 if no gesture detected =1 if an UP, =2 if a DOWN, =3 if an LEFT, =4 if a RIGHT
- gesture_fifo_threshold¶
Gesture fifo threshold value: range 0-3
- gesture_gain¶
Gesture gain value: range 0-3
- property proximity_interrupt_threshold: Tuple[int, int, int]¶
Tuple containing low and high threshold followed by the proximity interrupt persistance. When setting the proximity interrupt threshold values using a tuple of zero to three values: low threshold, high threshold, persistance. persistance defaults to 4 if not provided
colorutility
¶
Helper functions for color calculations
Author(s): Michael McWethy