-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
38 lines (33 loc) · 838 Bytes
/
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
from flask import Flask, render_template, redirect, url_for
import posetet as PT
import threading as TH
app = Flask(__name__, static_url_path='/static')
direct = None
@app.route("/")
@app.route('/index')
def home():
return render_template('tm.html')
@app.route("/center")
def center():
global direct
direct = "right"
return render_template('tm.html')
@app.route("/right")
def right():
global direct
direct = "right"
return render_template('tm.html')
@app.route("/left")
def left():
global direct
direct = "left"
return render_template('tm.html')
def LED_init():
global direct
thread1=TH.Thread(target=PT.main1, args=(direct,))
thread1.setDaemon(True)
thread1.start()
return
if __name__ == "__main__":
LED_init()
app.run()