adafruit / Adafruit_CircuitPython_HTU21D

CircuitPython driver for Adafruit's HTU21D-F temperature and humidity sensor
MIT License
2 stars 9 forks source link

Adding temp rh resolution #16

Closed jposada202020 closed 3 years ago

jposada202020 commented 3 years ago

Adding temp and RH resolution property. This comes together as a pack, so there were not separated.

Tested on

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather RP2040 with rp2040

with an Adafruit HTU21D-F sensor

Testing Code

import time
import board
from adafruit_htu21d import HTU21D

# import ht21_prop

i2c = board.I2C()
sensor = HTU21D(i2c)

for i in range(4):
    print("Before changing the User Register")
    print(bin(sensor.temp_rh_resolution))
    sensor.temp_rh_resolution = i
    print("After")
    print(bin(sensor.temp_rh_resolution))
    print("")
    time.sleep(0.5)