API Reference¶
qwiic_as6212¶
Python module for the [SparkFun Digital Temperature Sensor Breakout - AS6212 (Qwiic)](https://www.sparkfun.com/products/18521)
This python package is a port of the existing [SparkFun Qwiic AS6212 Sensor Arduino Library](https://github.com/sparkfun/SparkFun_TMP102_Arduino_Library/tree/master/examples)
This package can be used in conjunction with the overall [SparkFun qwiic Python Package](https://github.com/sparkfun/Qwiic_Py)
New to qwiic? Take a look at the entire [SparkFun qwiic ecosystem](https://www.sparkfun.com/qwiic).
- class qwiic_as6212.QwiicAs6212Sensor(address=None, i2c_driver=None)[source]¶
- 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 driver object is created.
- Returns
The AS6212 Sensor device object.
- Return type
Object
- begin()[source]¶
Initialize the operation of the Soil Moisture Sensor module :return: Returns true of the initialization was successful, otherwise False. :rtype: bool
- property connected¶
Determine if a Soil MoistureSensor device is conntected to the system.. :return: True if the device is connected, otherwise False. :rtype: bool
- get_alert_polarity()[source]¶
Get the polarity of Alert AS6212_ALERT_ACTIVE_HIGH (1) AS6212_ALERT_ACTIVE_LOW (0)
- get_consecutive_faults()[source]¶
Gets the number of consecutive faults that need to happen in a row before alert is changed. valid settings are 1,2,3 or 4 but this correspond to other bit values in the configuration register bits 11 and 12
- get_conversion_cycletime()[source]¶
Gets the conversion cycle time (aka conversion rate) in teh config reg Returns the cycle time in milliseconds: (125/250/1000/4000)
- get_interrupt_mode()[source]¶
Get the interrupt mode bit AS6212_MODE_COMPARATOR (0) AS6212_MODE_INTERRUPT (1)
- get_single_shot_status()[source]¶
gets the status of the single shot bit from the config register 0 = No conversion ongoing / conversion finished 1 = Start single shot conversion / conversion ongoing
- is_connected()[source]¶
Determine if a Soil MoistureSensor device is conntected to the system.. :return: True if the device is connected, otherwise False. :rtype: bool
- read_2_byte_register(register_to_read)[source]¶
Reads two bytes of data from a desired register. Combines them into a single 16 bit value Returns single value
- set_alert_polarity(polarity)[source]¶
Set the polarity of Alert AS6212_ALERT_ACTIVE_HIGH (1) AS6212_ALERT_ACTIVE_LOW (0)
- set_consecutive_faults(faults)[source]¶
Set the number of consecutive faults 1 - 1 fault 2 - 2 faults 3 - 3 faults 4 - 4 faults
- set_conversion_cycletime(cycletime)[source]¶
sets the conversion cylce time (aka convertion rate) in the config register valid settings are:
AS6212_CONVERSION_CYCLE_TIME_125MS AS6212_CONVERSION_CYCLE_TIME_250MS AS6212_CONVERSION_CYCLE_TIME_1000MS AS6212_CONVERSION_CYCLE_TIME_4000MS
- set_interrupt_mode(mode)[source]¶
sets the interrupt mode bits in the config register
valid options are: AS6212_MODE_COMPARATOR (0) AS6212_MODE_INTERRUPT (1)