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
10 changes: 10 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,20 @@ def background_thread():
socketio.emit('moisture_history', {'moisture_history': moisture_history})
time.sleep(5) # Update every 5 seconds

def turn_on_manual():
GPIO.output(4, GPIO.HIGH)
time.sleep(2)
GPIO.output(4, GPIO.LOW)


@app.route('/')
def index():
return render_template('index.html')

@app.route("/turn_on")
def turn_on_cmd():
turn_on_manual()

@app.route('/values')
def values():
temperature, humidity, moisture = read_sensor_data()
Expand Down