EasyManua.ls Logo

Adafruit Si7021 - Full Example Code

Default Icon
18 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
That's all there is to using the Si7021 sensor with CircuitPython!
Full Example Code
import time
import board
import busio
import adafruit_si7021
# Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_si7021.SI7021(i2c)
while True:
print("\nTemperature: %0.1f C" % sensor.temperature)
print("Humidity: %0.1f %%" % sensor.relative_humidity)
time.sleep(2)
© Adafruit Industries https://learn.adafruit.com/adafruit-si7021-temperature-plus-humidity-sensor Page 15 of 19