From c13fb08b9d22eed50453039abab2e41aa2ebecab Mon Sep 17 00:00:00 2001 From: Andrew Aikman Date: Tue, 17 Dec 2024 15:46:56 +0000 Subject: [PATCH] Added time based looping --- .../shedpi_module_am2320/README.md | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/standalone_modules/shedpi_module_am2320/README.md b/standalone_modules/shedpi_module_am2320/README.md index 8de0728..a04f76d 100644 --- a/standalone_modules/shedpi_module_am2320/README.md +++ b/standalone_modules/shedpi_module_am2320/README.md @@ -12,8 +12,34 @@ Pin 2 - SDA - GPIO (SDA) Pin 3 Pin 3 - gnd - Pin 6 Pin 4 - SCL - GPIO (SCL) pin 5 -## Software instalation +## Software installation + +Based on instructions found +here: https://learn.adafruit.com/adafruit-am2320-temperature-humidity-i2c-sensor/python-circuitpython ``` poetry add adafruit-circuitpython-am2320 ``` + +or for Pip + +``` +pip3 install adafruit-circuitpython-am2320 +``` + +```python +import time + +import adafruit_am2320 +import board + +# create the I2C shared bus +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +am = adafruit_am2320.AM2320(i2c) + +while True: + print("Temperature: ", am.temperature) + print("Humidity: ", am.relative_humidity) + time.sleep(2) +```