Skip to content

Commit

Permalink
am2301 simple example added
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-fryza committed Nov 19, 2024
1 parent b354412 commit 4bbba64
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Binary file added examples/12-dht/AM2301.pdf
Binary file not shown.
13 changes: 13 additions & 0 deletions examples/12-dht/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# See:
# https://docs.micropython.org/en/latest/esp8266/tutorial/dht.html
#

from machine import Pin
import dht

my_dht = dht.DHT22(Pin(18, Pin.IN, Pin.PULL_UP))

my_dht.measure()
print(f"{my_dht.temperature()} °C")
print(f"{my_dht.humidity()} %")

0 comments on commit 4bbba64

Please sign in to comment.