-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
51 lines (43 loc) · 1.34 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from flask import Flask, render_template, request, redirect, url_for
from leds import led
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/Mojito',methods=['POST'])
def Mojito():
if request.method == 'POST':
pass
return redirect(url_for('index'))
@app.route('/Vodka',methods=['POST'])
def Vodka():
if request.method == 'POST':
pass
return redirect(url_for('index'))
@app.route('/Pina_colada',methods=['POST'])
def Pina_colada():
if request.method == 'POST':
pass
return redirect(url_for('index'))
@app.route('/Izquierda',methods=['POST'])
def Izquierda():
if request.method == 'POST':
led.led1.on()
return redirect(url_for('index'))
@app.route('/Arriba',methods=['POST'])
def Arriba():
if request.method == 'POST':
led.led2.on()
return redirect(url_for('index'))
@app.route('/Derecha',methods=['POST'])
def Derecha():
if request.method == 'POST':
led.led3.on()
return redirect(url_for('index'))
@app.route('/Stop',methods=['POST'])
def Stop():
if request.method == 'POST':
led.off()
return redirect(url_for('index'))
if __name__ == '__main__':
app.run(debug=True,host="0.0.0.0")