Simple test
Ensure your device works with this simple test.
examples/hdc302x_simpletest.py
1# SPDX-FileCopyrightText: 2024 Liz Clark for Adafruit Industries
2#
3# SPDX-License-Identifier: MIT
4
5"""HDC302x simple test"""
6
7import time
8
9import board
10
11import adafruit_hdc302x
12
13i2c = board.I2C()
14sensor = adafruit_hdc302x.HDC302x(i2c)
15
16while True:
17 print(f"Temperature: {sensor.temperature:0.1f}°C")
18 print(f"Relative Humidity: {sensor.relative_humidity:0.1f}%")
19 print()
20 time.sleep(2)