Simple test¶
Ensure your device works with this simple test.
1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2# SPDX-License-Identifier: MIT
3
4import time
5import board
6import adafruit_am2320
7
8# create the I2C shared bus
9i2c = board.I2C() # uses board.SCL and board.SDA
10am = adafruit_am2320.AM2320(i2c)
11
12while True:
13 print("Temperature: ", am.temperature)
14 print("Humidity: ", am.relative_humidity)
15 time.sleep(2)