Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lab_app_final.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@

app = Flask(__name__)
app.debug = True # Make this False if you are no longer debugging
dhtDevice = adafruit_dht.DHT22(board.D17) #This needs to be initialized outside of the route function in order to avoid a Gateway-Time-out 504 error.


@app.route("/")
def hello():
Expand All @@ -71,7 +73,7 @@ def hello():
def lab_temp():
#import sys
#import Adafruit_DHT
dhtDevice = adafruit_dht.DHT22(board.D17)

temperature = dhtDevice.temperature
humidity = dhtDevice.humidity
#humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, 17)
Expand Down