Skip to content

Commit

Permalink
Added time based looping
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiky30 committed Dec 17, 2024
1 parent cf8283f commit c13fb08
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion standalone_modules/shedpi_module_am2320/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

0 comments on commit c13fb08

Please sign in to comment.