API Reference
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: I2C, address: int = 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.I2Cobject 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 = sensor.channel_415nm channel_445nm = sensor.channel_445nm channel_480nm = sensor.channel_480nm channel_515nm = sensor.channel_515nm channel_555nm = sensor.channel_555nm channel_590nm = sensor.channel_590nm channel_630nm = sensor.channel_630nm channel_680nm = sensor.channel_680nm
- astep: UnaryStruct
The integration time step size in 2.78 microsecond increments
- Return type:
- atime: UnaryStruct
The integration time step count. Total integration time will be
(ATIME + 1) * (ASTEP + 1) * 2.78µS- Return type:
- property flicker_detection_enabled: bool
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
- property gain: int
The ADC gain multiplier. Must be a valid
adafruit_as7341.Gain()
- class adafruit_as7341.Gain
Options for
accelerometer_rangeSetting
Gain Value
Gain.GAIN_0_5X0.5
Gain.GAIN_1X1
Gain.GAIN_2X2
Gain.GAIN_4X4
Gain.GAIN_8X8
Gain.GAIN_16X16
Gain.GAIN_32X32
Gain.GAIN_64X64
Gain.GAIN_128X128
Gain.GAIN_256X256
Gain.GAIN_512X512