Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app = Flask(__name__)
- @app.route("/")
- def homepage(title="homepage"):
- return render_template("BootGo.html", title=title)
- def add_motors_route(state, v1, v2, v3, v4):
- @app.route("/" + state, endpoint=state)
- def handler():
- set_motors(v1, v2, v3, v4)
- return homepage(title=state)
- add_motors_route("0", 0, 0, 0, 0)
- add_motors_route("25", 25, 25, 25, 25)
- add_motors_route("35", 35, 35, 35, 35)
- add_motors_route("45", 45, 45, 45, 45)
- add_motors_route("55", 55, 55, 55, 55)
- add_motors_route("65", 65, 65, 65, 65)
- add_motors_route("75", 75, 75, 75, 75)
- add_motors_route("90", 90, 90, 90, 90)
- add_motors_route("100", 100, 100, 100, 100)
- add_motors_route("1", 1, 1, 1, 1)
- add_motors_route("-25", -25, -25, -25, -25)
- add_motors_route("-35", -35, -35, -35, -35)
- add_motors_route("-45", -45, -45, -45, -45)
- add_motors_route("-55", -55, -55, -55, -55)
- add_motors_route("-65", -65, -65, -65, -65)
- add_motors_route("-75", -75, -75, -75, -75)
- add_motors_route("-90", -90, -90, -90, -90)
- add_motors_route("-100", -100, -100, -100, -100)
- if __name__ == "__main__":
- app.run(host="0.0.0.0", port=5000, debug=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement