adafruit_am2320
¶
This is a CircuitPython driver for the AM2320 temperature and humidity sensor.
Author(s): Limor Fried
Implementation Notes¶
Hardware:
Adafruit AM2320 Temperature & Humidity Sensor (Product ID: 3721)
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_am2320.AM2320(i2c_bus: I2C, address: int = 92)¶
A driver for the AM2320 temperature and humidity sensor.
- Parameters:
Quickstart: Importing and using the AM2320
Here is an example of using the
AM2320
class. First you will need to import the libraries to use the sensorimport board import adafruit_am2320
Once this is done you can define your
board.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA am = adafruit_am2320.AM2320(i2c)
Now you have access to the temperature using
temperature
attribute and the relative humidity using therelative_humidity
attributetemperature = am.temperature relative_humidity = am.relative_humidity