CircuitPython STTS22H Library¶
stts22h
¶
CircuitPython Driver for the STTS22H Temperature Sensor
Author(s): Jose D. Montoya
-
class stts22h.STTS22H(i2c_bus: busio.I2C, address: int =
0x3C
)[source]¶ Driver for the STTS22H Sensor connected over I2C.
- Parameters:¶
- Raises:¶
RuntimeError – if the sensor is not found
Quickstart: Importing and using the device
Here is an example of using the
STTS22H
class. First you will need to import the libraries to use the sensorimport board import stts22h
Once this is done you can define your
board.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA stts = stts22h.STTS22H(i2c)
Now you have access to the attributes
temp = stts.temperature
- property high_limit : bool¶
The bit is automatically reset to ‘0’ upon reading the STATUS register. :return: value if the temperature exceeds the high limit
- property low_limit : bool¶
The bit is automatically reset to ‘0’ upon reading the STATUS register. :return: value if the temperature went under the low limit