adafruit_as726x

Driver for the AS726x spectral sensors

  • Author(s): Dean Miller
class adafruit_as726x.Adafruit_AS726x(i2c_bus)

AS726x spectral sensor.

Parameters:i2c_bus (I2C) – The I2C bus connected to the sensor
MODE_0 = 0

Continuously gather samples of violet, blue, green and yellow. Orange and red are skipped and read zero.

MODE_1 = 1

Continuously gather samples of green, yellow, orange and red. Violet and blue are skipped and read zero.

MODE_2 = 2

Continuously gather samples of all colors

ONE_SHOT = 3

Gather a single sample of all colors and then stop

driver_led

True when the driver LED is on. False otherwise.

indicator_led

True when the indicator LED is on. False otherwise.

driver_led_current

The current limit for the driver LED in milliamps. One of:

  • 12.5 mA
  • 25 mA
  • 50 mA
  • 100 mA
indicator_led_current

The current limit for the indicator LED in milliamps. One of:

  • 1 mA
  • 2 mA
  • 4 mA
  • 8 mA
conversion_mode

The conversion mode. One of:

gain

The gain for the sensor

integration_time

The integration time in milliseconds between 2.8 and 714 ms

start_measurement()

Begin a measurement.

This will set the device to One Shot mode and values will not change after data_ready until start_measurement is called again or the conversion_mode is changed.

read_channel(channel)

Read an individual sensor channel

read_calibrated_value(channel)

Read a calibrated sensor channel

data_ready

True if the sensor has data ready to be read, False otherwise

temperature

The temperature of the device in Celsius

violet

Calibrated violet (450nm) value

blue

Calibrated blue (500nm) value

green

Calibrated green (550nm) value

yellow

Calibrated yellow (570nm) value

orange

Calibrated orange (600nm) value

red

Calibrated red (650nm) value

raw_violet

Raw violet (450nm) 16-bit value

raw_blue

Raw blue (500nm) 16-bit value

raw_green

Raw green (550nm) 16-bit value

raw_yellow

Raw yellow (570nm) 16-bit value

raw_orange

Raw orange (600nm) 16-bit value

raw_red

Raw red (650nm) 16-bit value