![]() |
Qwiic_AS726x_Py
2.0.0-1-gba196a5
Python for SFE Qwiic AS726x
|
Public Member Functions | |
def | __init__ (self, address=None, i2c_driver=None) |
Constructor. More... | |
def | is_connected (self) |
Determines if this device is connected. More... | |
def | begin (self, gain=kGain64x, measurementMode=kMeasurementMode6ChanOneShot) |
Initializes this device with default parameters. More... | |
def | take_measurements (self) |
Tells IC to take measurements and polls for data ready flag. More... | |
def | get_version (self) |
Get the version of the sensor. More... | |
def | take_measurements_with_bulb (self) |
Turns on bulb, takes measurements, turns off bulb. More... | |
def | get_temperature (self, device) |
Returns the temperature of a given device in Celsius. More... | |
def | get_temperature_f (self) |
Returns the temperature of a given device in Fahrenheit. More... | |
def | set_measurement_mode (self, mode) |
Sets the measurement mode. More... | |
def | get_measurement_mode (self) |
Get the measurement mode. More... | |
def | data_available (self) |
Check if the data ready flag is set in the control setup register. More... | |
def | enable_indicator (self) |
Enable the onboard indicator LED. More... | |
def | disable_indicator (self) |
Disable the onboard indicator LED. More... | |
def | set_indicator_current (self, current) |
Set the current limit of onboard LED. More... | |
def | enable_bulb (self) |
Enable the LED or bulb on a given device. More... | |
def | disable_bulb (self) |
Disable the LED or bulb on a given device. More... | |
def | set_bulb_current (self, current) |
Set the current for the specified LED. More... | |
def | set_gain (self, gain) |
Sets the gain value Gain 0: 1x (power-on default) Gain 1: 3.7x Gain 2: 16x Gain 3: 64x. More... | |
def | get_gain (self) |
Get the gain value. More... | |
def | soft_reset (self) |
Does a soft reset. More... | |
def | set_integration_time (self, integrationValue) |
Sets the integration cycle amount. More... | |
def | get_integration_time (self) |
Get the integration time. More... | |
def | enable_interrupt (self) |
Enable the interrupt pin. More... | |
def | disable_interrupt (self) |
Disable the interrupt pin. More... | |
def | get_violet (self) |
def | get_blue (self) |
def | get_green (self) |
def | get_yellow (self) |
def | get_orange (self) |
def | get_red (self) |
def | get_r (self) |
def | get_s (self) |
def | get_t (self) |
def | get_u (self) |
def | get_v (self) |
def | get_w (self) |
def | get_x (self) |
def | get_y (self) |
def | get_z (self) |
def | get_nir (self) |
def | get_dark (self) |
def | get_clear (self) |
def | get_calibrated_violet (self) |
def | get_calibrated_blue (self) |
def | get_calibrated_green (self) |
def | get_calibrated_yellow (self) |
def | get_calibrated_orange (self) |
def | get_calibrated_red (self) |
def | get_calibrated_r (self) |
def | get_calibrated_s (self) |
def | get_calibrated_t (self) |
def | get_calibrated_u (self) |
def | get_calibrated_v (self) |
def | get_calibrated_w (self) |
def | get_calibrated_x (self) |
def | get_calibrated_y (self) |
def | get_calibrated_z (self) |
def | get_calibrated_x1931 (self) |
def | get_calibrated_y1931 (self) |
def | get_calibrated_upri1976 (self) |
def | get_calibrated_vpri1976 (self) |
def | get_calibrated_u1976 (self) |
def | get_calibrated_v1976 (self) |
def | get_calibrated_duv1976 (self) |
def | get_calibrated_lux (self) |
def | get_calibrated_cct (self) |
def | get_channel (self, channelReg) |
Get the value of a channel. More... | |
def | get_calibrated_value (self, calAddress) |
Given an address, read four bytes and return the floating point calibrated value. More... | |
def | convert_bytes_to_float (self, myLong) |
Convert a 4-byte value containing the bytes of a float respresentation of a number to a float value. More... | |
def | clear_data_available (self) |
Clear the data ready flag in the config register. More... | |
def | virtual_read_register (self, virtualAddr) |
Read a virtual register from the AS726x. More... | |
def | virtual_write_register (self, virtualAddr, dataToWrite) |
Write a virtual register to the AS726x. More... | |
Public Attributes | |
address | |
kTxValid | |
Properties | |
connected = property(is_connected) | |
def qwiic_as726x.QwiicAS726x.__init__ | ( | self, | |
address = None , |
|||
i2c_driver = None |
|||
) |
Constructor.
int,optional | address: The I2C address to use for the device If not provided, the default address is used |
I2CDriver,optional | i2c_driver: An existing i2c driver object If not provided, a driver object is created |
def qwiic_as726x.QwiicAS726x.begin | ( | self, | |
gain = kGain64x , |
|||
measurementMode = kMeasurementMode6ChanOneShot |
|||
) |
Initializes this device with default parameters.
True
if successful, otherwise False
def qwiic_as726x.QwiicAS726x.clear_data_available | ( | self | ) |
Clear the data ready flag in the config register.
def qwiic_as726x.QwiicAS726x.convert_bytes_to_float | ( | self, | |
myLong | |||
) |
Convert a 4-byte value containing the bytes of a float respresentation of a number to a float value.
int | myLong: The 4-byte value to convert |
def qwiic_as726x.QwiicAS726x.data_available | ( | self | ) |
Check if the data ready flag is set in the control setup register.
True
if the data ready flag is set, otherwise False
def qwiic_as726x.QwiicAS726x.disable_bulb | ( | self | ) |
Disable the LED or bulb on a given device.
def qwiic_as726x.QwiicAS726x.disable_indicator | ( | self | ) |
Disable the onboard indicator LED.
def qwiic_as726x.QwiicAS726x.disable_interrupt | ( | self | ) |
Disable the interrupt pin.
def qwiic_as726x.QwiicAS726x.enable_bulb | ( | self | ) |
Enable the LED or bulb on a given device.
def qwiic_as726x.QwiicAS726x.enable_indicator | ( | self | ) |
Enable the onboard indicator LED.
def qwiic_as726x.QwiicAS726x.enable_interrupt | ( | self | ) |
Enable the interrupt pin.
def qwiic_as726x.QwiicAS726x.get_blue | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_blue | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_cct | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_duv1976 | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_green | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_lux | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_orange | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_r | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_red | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_s | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_t | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_u | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_u1976 | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_upri1976 | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_v | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_v1976 | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_value | ( | self, | |
calAddress | |||
) |
Given an address, read four bytes and return the floating point calibrated value.
int | calAddress: The address to read the calibrated value from |
def qwiic_as726x.QwiicAS726x.get_calibrated_violet | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_vpri1976 | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_w | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_x | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_x1931 | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_y | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_y1931 | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_yellow | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_calibrated_z | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_channel | ( | self, | |
channelReg | |||
) |
Get the value of a channel.
int | channel_register: The register to read the channel from |
def qwiic_as726x.QwiicAS726x.get_clear | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_dark | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_gain | ( | self | ) |
Get the gain value.
def qwiic_as726x.QwiicAS726x.get_green | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_integration_time | ( | self | ) |
Get the integration time.
def qwiic_as726x.QwiicAS726x.get_measurement_mode | ( | self | ) |
Get the measurement mode.
Allowable mode values are:
def qwiic_as726x.QwiicAS726x.get_nir | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_orange | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_r | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_red | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_s | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_t | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_temperature | ( | self, | |
device | |||
) |
Returns the temperature of a given device in Celsius.
int | device: The device to get the temperature from |
def qwiic_as726x.QwiicAS726x.get_temperature_f | ( | self | ) |
Returns the temperature of a given device in Fahrenheit.
int | device: The device to get the temperature from |
def qwiic_as726x.QwiicAS726x.get_u | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_v | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_version | ( | self | ) |
Get the version of the sensor.
Value is only valid after a call to begin()
def qwiic_as726x.QwiicAS726x.get_violet | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_w | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_x | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_y | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_yellow | ( | self | ) |
def qwiic_as726x.QwiicAS726x.get_z | ( | self | ) |
def qwiic_as726x.QwiicAS726x.is_connected | ( | self | ) |
Determines if this device is connected.
True
if connected, otherwise False
def qwiic_as726x.QwiicAS726x.set_bulb_current | ( | self, | |
current | |||
) |
Set the current for the specified LED.
int | current: The current to set the LED to |
Allowable current values are:
def qwiic_as726x.QwiicAS726x.set_gain | ( | self, | |
gain | |||
) |
Sets the gain value Gain 0: 1x (power-on default) Gain 1: 3.7x Gain 2: 16x Gain 3: 64x.
int | gain: The gain value to set |
def qwiic_as726x.QwiicAS726x.set_indicator_current | ( | self, | |
current | |||
) |
Set the current limit of onboard LED.
Default is max 8mA = 0b11.
int | current: The current limit to set the indicator LED to |
Allowable current values are:
def qwiic_as726x.QwiicAS726x.set_integration_time | ( | self, | |
integrationValue | |||
) |
Sets the integration cycle amount.
Give this function a byte from 0 to 255. Time will be 2.8ms * [integration cycles + 1]
int | integrationValue: The number of integration cycles to set |
def qwiic_as726x.QwiicAS726x.set_measurement_mode | ( | self, | |
mode | |||
) |
Sets the measurement mode.
Mode 0: 4 channels out of 6 (see datasheet) Mode 1: Different 4 channels out of 6 (see datasheet) Mode 2: All 6 channels continuously Mode 3: One-shot reading of all channels
int | mode: The mode to set |
Allowable mode values are:
def qwiic_as726x.QwiicAS726x.soft_reset | ( | self | ) |
Does a soft reset.
Give sensor at least 1000ms to reset
def qwiic_as726x.QwiicAS726x.take_measurements | ( | self | ) |
Tells IC to take measurements and polls for data ready flag.
True
if successful, otherwise False
def qwiic_as726x.QwiicAS726x.take_measurements_with_bulb | ( | self | ) |
Turns on bulb, takes measurements, turns off bulb.
NOTE: We don't turn on the indicator as it is red and may corrupt the readings
def qwiic_as726x.QwiicAS726x.virtual_read_register | ( | self, | |
virtualAddr | |||
) |
Read a virtual register from the AS726x.
int | virtualAddr: The virtual register address to read |
def qwiic_as726x.QwiicAS726x.virtual_write_register | ( | self, | |
virtualAddr, | |||
dataToWrite | |||
) |
Write a virtual register to the AS726x.
int | virtualAddr: The virtual register address to write |
int | dataToWrite: The value to write to the register |
True
if successful, otherwise False
qwiic_as726x.QwiicAS726x.address |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
qwiic_as726x.QwiicAS726x.kTxValid |
|
static |
|
static |