API Reference

qwiic_tmp102

Python module for the [SparkFun Qwiic TMP102 Sensor](https://www.sparkfun.com/products/16304)

This python package is a port of the existing [SparkFun Qwiic TMP102 Sensor Arduino Examples](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_tmp102.QwiicTmp102Sensor(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 TMP102 Sensor device object.

Return type

Object

alert()[source]

Returns state of Alert register

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_address()[source]

Returns the device address

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

one_shot(setOneShot=0)[source]

Sets the SingleShot Register. Returns 1 after the conversion is complete

read_high_temp_c()[source]

Gets T_HIGH (degrees C) alert threshold

read_high_temp_f()[source]

Reads T_HIGH register in F

read_low_temp_c()[source]

Gets T_LOW (degrees C) alert threshold

read_low_temp_f()[source]

Reads T_LOW register in F

read_temp_c()[source]

Reads the results from the sensor :rtype: integer

read_temp_f()[source]

Reads the results from the sensor :rtype: integer

set_alert_mode(mode)[source]

// Set Alert type // 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

set_alert_polarity(polarity)[source]

Set the polarity of Alert 0 - Active LOW 1 - Active HIGH

set_conversion_rate(rate)[source]

// Set the conversion rate (0-3) // 0 - 0.25 Hz // 1 - 1 Hz // 2 - 4 Hz (default) // 3 - 8 Hz

set_extended_mode(mode)[source]

Enable or disable extended mode 0 - disabled (-55C to +128C) 1 - enabled (-55C to +150C)

set_fault(faultSetting)[source]

Set the number of consecutive faults 0 - 1 fault 1 - 2 faults 2 - 4 faults 3 - 6 faults

set_high_temp_c(temperature)[source]

Sets T_LOW (degrees C) alert threshold

set_high_temp_f(temperature)[source]

Sets T_HIGH (degrees F) alert threshold

set_low_temp_c(temperature)[source]

Sets T_LOW (degrees C) alert threshold

set_low_temp_f(temperature)[source]

Sets T_LOW (degrees F) alert threshold

sleep()[source]

Switch sensor to low power mode

wakeup()[source]

Wakeup and start running in normal power mode