MicroPython SHTC3 Library¶
shtc3
¶
MicroPython Driver for the Sensirion SHTC3 Temperature and Humidity Sensor
Author(s): Bryan Siepert, Jose D. Montoya
-
class micropython_shtc3.shtc3.SHTC3(i2c, address: int =
0x70
)[source]¶ Driver for the SHTC3 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
SHTC3
class. First you will need to import the libraries to use the sensorfrom machine import Pin, I2C from micropython_shtc3 import shtc3
Once this is done you can define your
machine.I2C
object and define your sensor objecti2c = I2C(1, sda=Pin(2), scl=Pin(3)) sht = shtc3.SHTC3(i2c)
Now you have access to the attributes
temperature, relative_humidity = sht.measurements
- property measurements : tuple[float, float]¶
Take sensor readings. Temperature and Relative Humidity
- property operation_mode : str¶
Sensor operation_mode
Mode
Value
shtc3.SLEEP
0xB098
shtc3.WAKEUP
0x3517