adafruit_as7341
¶
CircuitPython library for use with the Adafruit AS7341 breakout
- Author(s): Bryan Siepert
Implementation Notes¶
Hardware:
- Adafruit AS7341 Breakout (Product ID: 4698)
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
- Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
-
class
adafruit_as7341.
AS7341
(i2c_bus, address=57)¶ Library for the AS7341 Sensor
Parameters: Quickstart: Importing and using the device
Here is an example of using the
AS7341
. First you will need to import the libraries to use the sensorimport board from adafruit_as7341 import AS7341
Once this is done you can define your
board.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA sensor = AS7341(i2c)
Now you have access to the different channels
channel_415nm = channel_415nm channel_445nm = channel_445nm channel_480nm = channel_480nm channel_515nm = channel_515nm channel_555nm = channel_555nm channel_590nm = channel_590nm channel_630nm = channel_630nm channel_680nm = channel_680nm
-
all_channels
¶ The current readings for all six ADC channels
-
astep
¶ The integration time step size in 2.78 microsecond increments
-
atime
¶ The integration time step count. Total integration time will be
(ATIME + 1) * (ASTEP + 1) * 2.78µS
-
channel_415nm
¶ The current reading for the 415nm band
-
channel_445nm
¶ The current reading for the 445nm band
-
channel_480nm
¶ The current reading for the 480nm band
-
channel_515nm
¶ The current reading for the 515nm band
-
channel_555nm
¶ The current reading for the 555nm band
-
channel_590nm
¶ The current reading for the 590nm band
-
channel_630nm
¶ The current reading for the 630nm band
-
channel_680nm
¶ The current reading for the 680nm band
-
channel_clear
¶ The current reading for the clear sensor
-
channel_nir
¶ The current reading for the NIR (near-IR) sensor
-
flicker_detected
¶ The flicker frequency detected in Hertz
-
flicker_detection_enabled
¶ The flicker detection status of the sensor. True if the sensor is configured to detect flickers. Currently only 1000Hz and 1200Hz flicker detection is supported
-
gain
¶ The ADC gain multiplier. Must be a valid
adafruit_as7341.Gain()
-
initialize
()¶ Configure the sensors with the default settings
-