openmv/scripts/examples/10-Arduino-Boards/Nano-33-BLE-Sense/01-Sensors/hts221.py
2023-07-05 19:03:37 +02:00

13 lines
255 B
Python

import time
import hts221
from machine import Pin, I2C
bus = I2C(1, scl=Pin(15), sda=Pin(14))
hts = hts221.HTS221(bus)
while True:
rH = hts.humidity()
temp = hts.temperature()
print("rH: %.2f%% T: %.2fC" % (rH, temp))
time.sleep_ms(100)