![]() |
Qwiic_TMP102_Py
packaging_test1-1-g6ea6532
Python for SFE Qwiic TMP102
|
Some devices have multiple available addresses - this is a list of these addresses. More...
Public Member Functions | |
def | __init__ (self, address=None, i2c_driver=None) |
def | is_connected (self) |
Determine if a Soil MoistureSensor device is conntected to the system. More... | |
def | begin (self) |
Initialize the operation of the Soil Moisture Sensor module. More... | |
def | get_address (self) |
Returns the device address. More... | |
def | read_temp_c (self) |
Reads the results from the sensor. More... | |
def | read_temp_f (self) |
Reads the results from the sensor. More... | |
def | set_conversion_rate (self, rate) |
Set the conversion rate (0-3) More... | |
def | set_extended_mode (self, mode) |
Enable or disable extended mode 0 - disabled (-55C to +128C) 1 - enabled (-55C to +150C) More... | |
def | sleep (self) |
Switch sensor to low power mode. More... | |
def | wakeup (self) |
Wakeup and start running in normal power mode. More... | |
def | set_alert_polarity (self, polarity) |
Set the polarity of Alert 0 - Active LOW 1 - Active HIGH. More... | |
def | alert (self) |
Returns state of Alert register. More... | |
def | one_shot (self, setOneShot=0) |
Sets the SingleShot Register. More... | |
def | set_low_temp_c (self, temperature) |
Sets T_LOW (degrees C) alert threshold. More... | |
def | set_high_temp_c (self, temperature) |
Sets T_LOW (degrees C) alert threshold. More... | |
def | set_low_temp_f (self, temperature) |
Sets T_LOW (degrees F) alert threshold. More... | |
def | set_high_temp_f (self, temperature) |
Sets T_HIGH (degrees F) alert threshold. More... | |
def | read_low_temp_c (self) |
Gets T_LOW (degrees C) alert threshold. More... | |
def | read_high_temp_c (self) |
Gets T_HIGH (degrees C) alert threshold. More... | |
def | read_low_temp_f (self) |
Reads T_LOW register in F. More... | |
def | read_high_temp_f (self) |
Reads T_HIGH register in F. More... | |
def | set_fault (self, faultSetting) |
Set the number of consecutive faults. More... | |
def | set_alert_mode (self, mode) |
Set Alert type. More... | |
def | read_block_pointer_reg (self, reg, numBytes=2) |
To read from the device, we first write the register we want to read then explicitly send a stop bit. More... | |
Public Attributes | |
address | |
tempC | |
tempF | |
Static Public Attributes | |
device_name = _DEFAULT_NAME | |
available_addresses = _AVAILABLE_I2C_ADDRESS | |
Properties | |
connected = property(is_connected) | |
Some devices have multiple available addresses - this is a list of these addresses.
NOTE: The first address in this list is considered the default I2C address for the device.
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. |
def qwiic_tmp102.QwiicTmp102Sensor.__init__ | ( | self, | |
address = None , |
|||
i2c_driver = None |
|||
) |
def qwiic_tmp102.QwiicTmp102Sensor.alert | ( | self | ) |
Returns state of Alert register.
def qwiic_tmp102.QwiicTmp102Sensor.begin | ( | self | ) |
Initialize the operation of the Soil Moisture Sensor module.
def qwiic_tmp102.QwiicTmp102Sensor.get_address | ( | self | ) |
Returns the device address.
def qwiic_tmp102.QwiicTmp102Sensor.is_connected | ( | self | ) |
Determine if a Soil MoistureSensor device is conntected to the system.
def qwiic_tmp102.QwiicTmp102Sensor.one_shot | ( | self, | |
setOneShot = 0 |
|||
) |
Sets the SingleShot Register.
Returns 1 after the conversion is complete
int | setOneShot: 0 - Continuous conversion (default) |
def qwiic_tmp102.QwiicTmp102Sensor.read_block_pointer_reg | ( | self, | |
reg, | |||
numBytes = 2 |
|||
) |
To read from the device, we first write the register we want to read then explicitly send a stop bit.
Then, restart the connection to read the data from the device.
See datasheet page. 13
int | reg: The register to read from. |
int | numBytes: The number of bytes to read. |
def qwiic_tmp102.QwiicTmp102Sensor.read_high_temp_c | ( | self | ) |
Gets T_HIGH (degrees C) alert threshold.
def qwiic_tmp102.QwiicTmp102Sensor.read_high_temp_f | ( | self | ) |
Reads T_HIGH register in F.
def qwiic_tmp102.QwiicTmp102Sensor.read_low_temp_c | ( | self | ) |
Gets T_LOW (degrees C) alert threshold.
def qwiic_tmp102.QwiicTmp102Sensor.read_low_temp_f | ( | self | ) |
Reads T_LOW register in F.
def qwiic_tmp102.QwiicTmp102Sensor.read_temp_c | ( | self | ) |
Reads the results from the sensor.
def qwiic_tmp102.QwiicTmp102Sensor.read_temp_f | ( | self | ) |
Reads the results from the sensor.
def qwiic_tmp102.QwiicTmp102Sensor.set_alert_mode | ( | self, | |
mode | |||
) |
Set Alert type.
int | mode: The mode to set the alert to. 0 - Comparator Mode: Active from temp > T_HIGH until temp < T_LOW 1 - Thermostat Mode: Active when temp > T_HIGH until any read operation occurs |
def qwiic_tmp102.QwiicTmp102Sensor.set_alert_polarity | ( | self, | |
polarity | |||
) |
Set the polarity of Alert 0 - Active LOW 1 - Active HIGH.
def qwiic_tmp102.QwiicTmp102Sensor.set_conversion_rate | ( | self, | |
rate | |||
) |
Set the conversion rate (0-3)
@ param int rate: The rate to set the conversion to. 0 - 0.25 Hz 1 - 1 Hz 2 - 4 Hz (default) 3 - 8 Hz
def qwiic_tmp102.QwiicTmp102Sensor.set_extended_mode | ( | self, | |
mode | |||
) |
Enable or disable extended mode 0 - disabled (-55C to +128C) 1 - enabled (-55C to +150C)
def qwiic_tmp102.QwiicTmp102Sensor.set_fault | ( | self, | |
faultSetting | |||
) |
Set the number of consecutive faults.
int | faultSetting: The number of consecutive faults to trigger an alert. 0 - 1 fault 1 - 2 faults 2 - 4 faults 3 - 6 faults |
def qwiic_tmp102.QwiicTmp102Sensor.set_high_temp_c | ( | self, | |
temperature | |||
) |
Sets T_LOW (degrees C) alert threshold.
def qwiic_tmp102.QwiicTmp102Sensor.set_high_temp_f | ( | self, | |
temperature | |||
) |
Sets T_HIGH (degrees F) alert threshold.
def qwiic_tmp102.QwiicTmp102Sensor.set_low_temp_c | ( | self, | |
temperature | |||
) |
Sets T_LOW (degrees C) alert threshold.
float | temperature: The temperature in Celsius to set the alert threshold to. |
def qwiic_tmp102.QwiicTmp102Sensor.set_low_temp_f | ( | self, | |
temperature | |||
) |
Sets T_LOW (degrees F) alert threshold.
float | temperature: The temperature in Fahrenheit to set the alert threshold to. |
def qwiic_tmp102.QwiicTmp102Sensor.sleep | ( | self | ) |
Switch sensor to low power mode.
def qwiic_tmp102.QwiicTmp102Sensor.wakeup | ( | self | ) |
Wakeup and start running in normal power mode.
qwiic_tmp102.QwiicTmp102Sensor.address |
|
static |
|
static |
qwiic_tmp102.QwiicTmp102Sensor.tempC |
qwiic_tmp102.QwiicTmp102Sensor.tempF |
|
static |