QwiicSGP40.
More...
QwiicSGP40.
- Parameters
-
address | The I2C address to use for the device. If not provided, the default address is used. |
i2c_driver | An existing i2c driver object. If not provided a a driver object is created. |
- Returns
- Object The GPIO device object.
◆ __init__()
def qwiic_sgp40.qwiic_sgp40.QwiicSGP40.__init__ |
( |
|
self, |
|
|
|
address = None , |
|
|
|
i2c_driver = None |
|
) |
| |
◆ begin()
def qwiic_sgp40.qwiic_sgp40.QwiicSGP40.begin |
( |
|
self, |
|
|
|
warm_up_time = 10 |
|
) |
| |
Initialize the operation of the Qwiic SGP40 and wait through warm- up time.
Run is_connected() and measure_test().
- Returns
- bool Returns true if the intialization was successful, false otherwise.
◆ get_VOC_index()
def qwiic_sgp40.qwiic_sgp40.QwiicSGP40.get_VOC_index |
( |
|
self, |
|
|
|
__relative_humidity = 50 , |
|
|
|
__temperature_c = 25 |
|
) |
| |
Get VOC index.
- Parameters
-
__relative_humidity | float relative humidity between 0 and 100%. |
__temperature_c | float temperature in celcius between -45 and 130 degrees. |
- Returns
- int VOC index
◆ heater_off()
def qwiic_sgp40.qwiic_sgp40.QwiicSGP40.heater_off |
( |
|
self | ) |
|
Turns the hotplate off and puts sensor in idle mode.
◆ is_connected()
def qwiic_sgp40.qwiic_sgp40.QwiicSGP40.is_connected |
( |
|
self | ) |
|
Determine if a Qwiic SGP40 device is connected to the system.
- Returns
- bool True if the device is connected, false otherwise.
◆ measure_raw()
def qwiic_sgp40.qwiic_sgp40.QwiicSGP40.measure_raw |
( |
|
self, |
|
|
|
__relative_humidity = 50 , |
|
|
|
__temperature_c = 25 |
|
) |
| |
Returns the raw data.
See the SGP40 datasheet for more info.
- Parameters
-
SRAW_ticks | variable to assign raw measurement to |
__relative_humidity | float relative humidity between 0 and 100%. |
__temperature_c | float temperature in celcius between -45 and 130 degrees. |
- Returns
- int 0 if CRC checks out, -1 otherwise
◆ measure_test()
def qwiic_sgp40.qwiic_sgp40.QwiicSGP40.measure_test |
( |
|
self | ) |
|
Sensor runs chip self test.
- Returns
- int Returns 0 if the self-test succeeded and 1 if it failed.
◆ soft_reset()
def qwiic_sgp40.qwiic_sgp40.QwiicSGP40.soft_reset |
( |
|
self, |
|
|
|
ignore_error = True |
|
) |
| |
Sensor reset.
- Parameters
-
bool,optional | ignore_error: Whether to ignore exception that can be raised due to no ACK after reset command, defaults to True |
◆ address
qwiic_sgp40.qwiic_sgp40.QwiicSGP40.address |
◆ available_addresses
qwiic_sgp40.qwiic_sgp40.QwiicSGP40.available_addresses = _AVAILABLE_I2C_ADDRESS |
|
static |
◆ device_name
qwiic_sgp40.qwiic_sgp40.QwiicSGP40.device_name = _DEFAULT_NAME |
|
static |
◆ DURATION_READ_RAW_VOC
float qwiic_sgp40.qwiic_sgp40.QwiicSGP40.DURATION_READ_RAW_VOC = 0.03 |
|
static |
◆ DURATION_WAIT_MEASURE_TEST
float qwiic_sgp40.qwiic_sgp40.QwiicSGP40.DURATION_WAIT_MEASURE_TEST = 0.25 |
|
static |
◆ SGP40_HEATER_OFF
list qwiic_sgp40.qwiic_sgp40.QwiicSGP40.SGP40_HEATER_OFF = [0x36, 0x15] |
|
static |
◆ SGP40_MEASURE_RAW
list qwiic_sgp40.qwiic_sgp40.QwiicSGP40.SGP40_MEASURE_RAW = [0x26, 0x0F] |
|
static |
◆ SGP40_MEASURE_TEST
list qwiic_sgp40.qwiic_sgp40.QwiicSGP40.SGP40_MEASURE_TEST = [0x28, 0x0E] |
|
static |
◆ SGP40_MEASURE_TEST_FAIL
list qwiic_sgp40.qwiic_sgp40.QwiicSGP40.SGP40_MEASURE_TEST_FAIL = [0x4B, 0x00] |
|
static |
◆ SGP40_MEASURE_TEST_PASS
list qwiic_sgp40.qwiic_sgp40.QwiicSGP40.SGP40_MEASURE_TEST_PASS = [0xD4, 0x00] |
|
static |
◆ SGP40_SOFT_RESET
list qwiic_sgp40.qwiic_sgp40.QwiicSGP40.SGP40_SOFT_RESET = [0x00, 0x06] |
|
static |
The documentation for this class was generated from the following file: