I'm not sure how to use the external temperature/humidity sensor (via Stemma QT connector next to power socket)....
When I run this code:
- Code: Select all | TOGGLE FULL SIZE
import board
import busio
REGISTERS = (0, 256) # Range of registers to read, from the first up to (but
# not including!) the second value.
REGISTER_SIZE = 2 # Number of bytes to read from each register.
# Initialize and lock the I2C bus.
i2c = busio.I2C(board.SCL, board.SDA)
while not i2c.try_lock():
pass
# Find the first I2C device available.
devices = i2c.scan()
while len(devices) < 1:
devices = i2c.scan()
print([hex(x) for x in devices])
I get this output:
- Code: Select all | TOGGLE FULL SIZE
code.py output:
['0x1c', '0x39', '0x44', '0x6a', '0x77']
The output is the same with and without the sensor being connected. Does this mean it's not being detected? Or is it because it's using the same address as the onboard sensor? ...
I noticed the CLUE Circuit Python example for temperature and humidity doesn't work when I have the sensor connected. It says "RuntimeError: CRC mismatch".
Does anyone know the how to use an external SHT31-D sensor with CLUE?
Thank you ;)